Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is PHP curl to HTTPS secure?

Tags:

http

php

curl

https

I read these two things:

  • Sending data from HTTP to HTTPS is not safe.
  • Curl is as secure as a normal HTTP request.

Putting these together, would sending a password to an HTTPS server through curl be insecure? Do both servers need HTTPS in order to be secure?

like image 970
Kris Avatar asked Oct 17 '25 18:10

Kris


1 Answers

Using curl in php is safe as long as you don't disabled the certificate verification.

Do not touch CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER, their default values are the secure ones.

https://secure.php.net/manual/fr/function.curl-setopt.php

like image 96
Tom Avatar answered Oct 19 '25 08:10

Tom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!