note 60142 added to function.curl-setopt
| From: | DustinHawkins at osu1 dot php dot net | Date: | Tue, 27 Dec 2005 22:24:15 +0000 |
| Subject: | note 60142 added to function.curl-setopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-100818@lists.php.net to get a copy of this message | ||
To further expand upon use of CURLOPT_CAPATH and CURLOPT_CAINFO...
In my case I wanted to prevent curl from talking to any HTTPS server except my own using a self
signed certificate. To do this, you'll need openssl installed and access to the HTTPS Server
Certificate (server.crt by default on apache)
You can then use a command simiar to this to translate your apache certificate into one that curl
likes.
$ openssl x509 -in server.crt -out outcert.pem -text
Then set CURLOPT_CAINFO equal to the the full path to outcert.pem and turn on
CURLOPT_SSL_VERIFYPEER.
If you want to use the CURLOPT_CAPATH option, you should create a directory for all the valid
certificates you have created, then use the c_rehash script that is included with openssl to
"prepare" the directory.
If you dont use the c_rehash utility, curl will ignore any file in the directory you set.
----
Manual Page -- http://www.php.net/manual/en/function.curl-setopt.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60142
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60142&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60142&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60142&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60142&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60142&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60142&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60142&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60142&report=yes
Search -- http://master.php.net/manage/user-notes.php