Answer the question
In order to leave comments, you need to log in
What's the difference between http and https for API?
Engaged in API maintenance (between servers) on one of the projects. Now projects are moving to https (CA Certificate, different domains).
So the question arose, should anything be changed? Doesn't it need to add sending certificates or something else?
Example of a request between servers:
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $requestBody);
$responseBody = curl_exec($ch);
curl_close ($ch);
$response = json_decode($responseBody);
Answer the question
In order to leave comments, you need to log in
It should work right away, if your SSL certificate is not real, but self-signed, then you also need to disable certificate verification:curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false)
Problemma can arise with a chain of certificates. If the certificates are in order, then the system software will provide HTTPS support. In particular, make sure that the CA certificate is installed correctly on all servers. If the browser tends to tell the user when a site doesn't comply with SSL requirements, then the server will most likely simply reject the connection. Faced such a problem when setting up servers of the windows family.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question