Problem with REST resource asset


(Mahearnpad) #1

While I can get a 200 response and expected data back from the API on my (non Matrix) server (in another domain), using the Chrome Postman extension, when I attempt to access it using both the Matrix REST js resource, and REST resource assets, I get the following error message:

"cURL request failed: 'https://mydomain/api/search?term=amox': Peer certificate cannot be authenticated with known CA certificates".  

Note I have removed the actual webserver address due to need to keep it private.

 

And I've tried both none and Basic HTTP auth with same results as above.

 

Any ideas how I can fix this?

 

tia

Michael


(Bart Banda) #2

Something to do with the SSL Certificate it seems. What version are you on? And does everything still work as expected? It's just the error that is bugging you?


(Mahearnpad) #3

Apart from the SSL, the message response is empty. I'm not even getting any http response error codes back as far as I can see. This is from the test output screen.  I've renamed the actual api path to protect the innocent.

 

"request" => array (
    "method" => "GET",
    "headers" => array (
        [Empty]
    ),
    "body" => "",
    "urls" => array (
        0 => "https://mydomain/api/query/search?term=amoxSQ_BACKEND_PAGE=main&backend_section=am&am_section=edit_asset&assetid=240947&sq_asset_path=1,141721,141726,212238,237199,240947&asset_ei_screen=details&sq_link_path=,0,267420,267425,398085,455157,465469" 
    ),
    "auth" => array (
        "type" => "HTTP_Basic",
        "http_auth_options" => array (
            "username" => "",
            "password" => "" 
        ) 
    ),
    "url" => "https://mydomain/api/query/search?term=amoxSQ_BACKEND_PAGE=main&backend_section=am&am_section=edit_asset&assetid=240947&sq_asset_path=1,141721,141726,212238,237199,240947&asset_ei_screen=details&sq_link_path=,0,267420,267425,398085,455157,465469" 
),
"responses" => array (
    0 => array (
        "body" => ,
        "headers" => array (
            [Empty]
        ),
        "info" => array (
            "url" => "https://mydomain/api/query/search?term=amoxSQ_BACKEND_PAGE=main&backend_section=am&am_section=edit_asset&assetid=240947&sq_asset_path=1,141721,141726,212238,237199,240947&asset_ei_screen=details&sq_link_path=,0,267420,267425,398085,455157,465469",
            "content_type" => ,
            "http_code" => 0,
            "header_size" => 0,
            "request_size" => 0,
            "filetime" => -1,
            "ssl_verify_result" => -8172,
            "redirect_count" => 0,
            "total_time" => 0,
            "namelookup_time" => 0.000713,
            "connect_time" => 0.00563,
            "pretransfer_time" => 0,
            "size_upload" => 0,
            "size_download" => 0,
            "speed_download" => 0,
            "speed_upload" => 0,
            "download_content_length" => -1,
            "upload_content_length" => -1,
            "starttransfer_time" => 0,
            "redirect_time" => 0,
            "certinfo" => array (
                [Empty]
            ) 
        ),
        "source" => "remote",
        "expiry" => 0 
    ) 
),

(Bart Banda) #4

I had a similar issue when I upgraded to 4.18.2 when it was first released as there was a bug there that got fixed:

 

http://bugs.matrix.squiz.net/view_bug.php?bug_id=6747

 

Which was originally caused by this fix:

 

http://bugs.matrix.squiz.net/view_bug.php?bug_id=6703

 

If you are on version 4.18.2 or 4.16.6 you might be affected by this. 

 

The following fix was put in place to resolve the issue in file: packages/web_services/rest/page_templates/page_rest_resource_js/page_rest_resource_js.inc

function __construct($assetid=0)
    {
      $this->_ser_attrs = TRUE;
      parent::__construct($assetid);
}//end constructor

Are you on one of those versions?


(Mahearnpad) #5

We're on 4.12 - seems a bit behind those versions you mentioned, so yes, we may indeed need to add the patch.  I'll find out from our contact at Squiz whether it needs to be fixed. Squiz hosts our system, so my hands are tied as far as getting in a fixing anything myself is concerned.

 

Thanks for your reply Bart.


(Bart Banda) #6

It might not be this patch then that will fix your issue, but some other bug fix that you need. But yes, contact Squiz Support directly and see if they can help you. Feel free to post your findings here. 


(Oleg Voronin) #7

I've run into what I believe to be a similar issue when accessing some of our pre-production environments (via their own subdomain names). None of them had a SSL certificate that could be validated, so "Disable SSL Certificate" option has been used - but you might have luck with something less drastic.