Enabling tls negotiation in a socket
| From: | Jehan Pagès | Date: | Fri, 09 Jan 2009 13:10:22 +0000 |
| Subject: | Enabling tls negotiation in a socket | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-285820@lists.php.net to get a copy of this message | ||
Hi,
I have a question about opening a normal socket, then negotiating a TLS
layer in PHP (through another protocol, which is XMPP in my case, in plain
text at the beginning). I am currently using a socket created by
"socket_create ()". But there seems not to be any way of switching to TLS
negotiation with this, is there?
Then I see the stream_socket_client () which can then switch to TLS with
stream_socket_enable_crypto (). But this is only above PHP 5.1.0. Can anyone
confirm me this is the right solution, and also only solution? (I mean
"already made" one, I am not going to implement TLS myself! :p)
How would you do such a thing otherwise? And is it possible to use
stream_socket_enable_crypto () on the socket created by socket_create?
Thanks all.
Jehan