Curl With Certificates As Strings
| From: | Gustafson, Tim | Date: | Thu, 09 Feb 2006 13:30:44 +0000 |
| Subject: | Curl With Certificates As Strings | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-230152@lists.php.net to get a copy of this message | ||
Hello!
Can Curl be configured to use SSL certificates in strings, rather than in files? I am storing my
user's certificates in a mySQL database, and I don't really want to write those
certificates to a file, and then use the file, and then delete them when I'm done. I would
much rather just pass the certificate to Curl as a string instead.
For example, instead of:
curl_setopt($Curl, CURLOPT_SSLCERT, "/tmp/cert.pem");
I would like to do:
$UserQuery = mysql_query("select * from Users where ID = 1000", $Database);
$UserRow = mysql_fetch_assoc($UserQuery);
curl_setopt($Curl, CURLOPT_SSLCERT, $UserRow["Certificate"]);
Is that possible? If it isn't using Curl, is there some other library I could use to
accomplish this? All I need to do is simple HTTPS posts and gets.
Tim Gustafson
MEI Technology Consulting, Inc
tjg@meitech.com
(516) 379-0001 Office
(516) 908-4185 Fax
http://www.meitech.com/