note 71326 added to ref.curl
| From: | pyroevi at yahoo dot com | Date: | Wed, 22 Nov 2006 18:33:56 +0000 |
| Subject: | note 71326 added to ref.curl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119985@lists.php.net to get a copy of this message | ||
I was working on using php to interface with an authorize.net gateway, and I ran into a problem with
certificates using curl to talk the https:// url.
curl_error() told me "SSL certificate problem, verify that the CA cert is OK."
I googled it and found the same "solution" over and over again: bypass verification by
adding this line after curl_init():
curl_setopt($connection, CURLOPT_SSL_VERIFYPEER, false);
This worked great, but I was required to verify, so here's what I did. Add the following lines:
curl_setopt($connection, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($AuthNetConn, CURLOPT_CAINFO, "path:/ca-bundle.crt");
with "path:/ca-bundle.crt" being the path to that certificate file. You can get this file
by downloading the curl package (http://curl.haxx.se/download.html) and looking for it in the lib
folder.
Feel free to email me.
----
Server IP: 66.163.161.117
Probable Submitter: 74.138.184.110
----
Manual Page -- http://www.php.net/manual/en/ref.curl.php
Edit -- https://master.php.net/note/edit/71326
Del: integrated -- https://master.php.net/note/delete/71326/integrated
Del: useless -- https://master.php.net/note/delete/71326/useless
Del: bad code -- https://master.php.net/note/delete/71326/bad+code
Del: spam -- https://master.php.net/note/delete/71326/spam
Del: non-english -- https://master.php.net/note/delete/71326/non-english
Del: in docs -- https://master.php.net/note/delete/71326/in+docs
Del: other reasons-- https://master.php.net/note/delete/71326
Reject -- https://master.php.net/note/reject/71326
Search -- https://master.php.net/manage/user-notes.php