RE: [PHP] SSL and CURL question --
| From: | Leavell Digital Design | Date: | Wed, 16 May 2001 05:23:10 +0000 |
| Subject: | RE: [PHP] SSL and CURL question -- | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-52988@lists.php.net to get a copy of this message | ||
Can't help you with your code but, you may want to check out the snoopy
class at Sourceforge.net.
http://sourceforge.net/projects/snoopy/
It uses ssl and cURL. Works pretty well.
Kevin Leavell
Leavell Digital Design Inc.
P 406.829.8989
C 406.240.4595
---> -----Original Message-----
---> From: phpman [mailto:info@graphicon.nu]
---> Sent: Tuesday, May 15, 2001 4:43 PM
---> To: php-general@lists.php.net
---> Subject: [PHP] SSL and CURL question --
--->
--->
---> CURL is realy cool, lets me do easy socket stuff, especially with
---> ssl, which leads me to my question:
--->
---> How on God's green earth do I send more then simple requests to a SSL
---> server? Here's my basic request...
--->
---> POST /apps.here/xml/Rate HTTP/1.1
---> Content-Type: application/xml
---> Content-Length: 1074
--->
---> <?xml version=1.0 encoding="UTF-8"?>
---> <xml stuff here>blah.......</xml stuff here>
--->
--->
---> the CURL code (so far)
--->
---> $xml_req="this is the xml doc";
---> $l=strlen($xml_req);
--->
---> $url="https://www.secureserver.com/apps.here/xml/Rate";
---> $tmp_out=time() . ".tmp.xml.out";
---> $fp = fopen ("/public/nirvana/" . $tmp_out, "w+");
---> fwrite($fp, $xml_req, $l);
--->
---> $ch = curl_init ();
---> curl_setopt ($ch, CURLOPT_URL, $url);
---> curl_setopt ($ch, CURLOPT_SSLVERSION, 3);
---> curl_setopt ($ch, CURLOPT_HEADER, 0);
---> curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "POST /apps.here/xml/Rate
---> HTTP/1.1");
---> curl_setopt ($ch, CURLOPT_HTTPHEADER, "Content-Type: application/xml");
---> curl_setopt ($ch, CURLOPT_INFILE, $fp);
---> curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
---> // curl_setopt ($ch, CURLOPT_VERBOSE, 1);
---> // curl_setopt ($ch, CURLOPT_POST, 1);
--->
---> $results = curl_exec ($ch);
---> fclose($fp);
---> curl_close ($ch);
--->
--->
--->
---> the tmp xml file displays the correct stuff. I'm totally
---> confused and there
---> is basically NO curl ssl support docs anywhere.
--->
---> distraut in buffalo,
--->
---> dave
--->
--->
--->
--->
---> --
---> PHP General Mailing List (http://www.php.net/)
---> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
---> For additional commands, e-mail: php-general-help@lists.php.net
---> To contact the list administrators, e-mail:
---> php-list-admin@lists.php.net