L
L
Leonid2021-12-03 01:07:33
System administration
Leonid, 2021-12-03 01:07:33

What's wrong with PHP curl on HTTPS request?

Have a request

$request = curl_init();

            curl_setopt_array($request, [
                CURLOPT_PORT           => 3111,
                CURLOPT_URL            => "https://sign.sysenterprise.com/",
                CURLOPT_POST           => false,
                CURLOPT_ENCODING       => "",
                CURLOPT_MAXREDIRS      => 10,
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_CONNECTTIMEOUT => 20,
                CURLOPT_HTTP_VERSION   => CURL_HTTP_VERSION_1_1,
                CURLOPT_SSL_VERIFYPEER   => true 
                
            ]);

            $ret = curl_exec($request);


the server on the node with a self-signed certificate

responds with a
SSL certificate problem: self signed certificate

possibly crooked certificate, but everything works from postman or https://reqbin.com/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
paran0id, 2021-12-03
@caballero

CURLOPT_SSL_VERIFYPEER => false
Add, this will disable certificate verification. Or add the certificate to trusted on this machine.
The certificate is not something that would be crooked - it is self-signed, which curl swears at.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question