Such a problem when I make a request using curl to the https server returns an error

SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed 

If you set the parameter

 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 

Then the answer comes:

 405 - HTTP verb used to access this page is not allowed.</h2> The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access. 

Maybe someone knows how to overcome it. Through the Chrome plugin, the request is normally sent and the answer comes without any certificates

    2 answers 2

    Is your server Take the keys from him and transfer them to CURL.

     curl_setopt($curl,CURLOPT_CAINFO,'/path/1.cert'); curl_setopt($curl,CURLOPT_SSLCERT,'/path/2.pem'); curl_setopt($curl,CURLOPT_SSLKEY,'/path/3.key'); 

    Ways to prescribe the necessary and correct, well, send a request

    • No, the request goes to a third-party server. I do not have certificates and keys, respectively, too. From the side of this server they say that they are not needed on the client - oldy
    • @oldy when they talk about a client means a browser, but because you connect through curl, then you need to think about it yourself, how to accept their certificates. - Artem

    Try this:

     curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); 
    • No, it comes "405 - HTTP verb used to access this page is not allowed." I solved the problem with the help of file_get_content, with curl I did not manage to figure out what the problem was ( - oldy
    • Try the [getInfo ()] [1] [1] function: pastebin.com/NPNQfMcX - Ravel