I am trying to connect via an SSL socket to a remote server (ITunes Push service, but that’s pretty irrelevant).
I have it working using stream_context_set_option($context, 'ssl', 'local_cert', $pemFile); where $pemFile is the location of a local .pem file. But, as the software will be managing many accounts each with their own certificate I would like to store the certificates in the database to ease management.
So, my question is: Is there a way to use the certificate content directly instead of pointing to a file in the file system?
(I am using the PHP5.2, Zend Framework if there are any tools in there to help)
It doesn’t appear that there is a way to use a string as the certificate. The only option seems to be to write the file to disk temporarily, using tmpfile() or similar and use that.