How to verify HTTPS url

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
srinivasmcs
Forum Newbie
Posts: 1
Joined: Thu Apr 09, 2015 2:07 am

How to verify HTTPS url

Post by srinivasmcs »

Hi,

Any one can you please explain how to verify, and send https url using curl_setopt.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: How to verify HTTPS url

Post by Christopher »

You just need to set the protocol to HTTPS in the URL (CURLOPT_URL). If you have problems with some some certificates, you can add certificate authority information using:

CURLOPT_CAINFO "/path/to/my/cacert.pem"

If you absolutely cannot get it to authorize, you can test if it is a certificate/authority issue by doing:

CURLOPT_SSL_VERIFYPEER false,

If that works, then track down the problem with the certificate/authority, fix it, and set CURLOPT_SSL_VERIFYPEER back to true.
(#10850)
Post Reply