A
A
Arman2015-12-21 14:27:32
PHP
Arman, 2015-12-21 14:27:32

How to make requests over https?

Good afternoon.
Didn't work with certificates at all.
There is a script in php, through curl it requests the pages of the site via https. Costs

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

But it would be desirable to understand and do correctly requests with certificates. I found options how to insert certificate files, etc., but where do I get them from? How to work with them correctly? Do they need to be signed somehow or something?
the script does not work without disabling these parameters, but the wget utility is calm.
Maybe there are ready-made articles?
thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton B, 2015-12-21
@Arik

If everything is in order with the certificates on the server to which the request is being made, then the settings that you specified above are not needed, php curl will work correctly. But if the certificates on that server are self-signed, then you need to use your settings.
In any case, the connection will be protected by the ssl protocol.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question