walkor / workerman

An asynchronous event driven PHP socket framework. Supports HTTP, Websocket, SSL and other custom protocols.
http://www.workerman.net
MIT License
11.03k stars 2.25k forks source link

ssl secure connection #1027

Open phrazer opened 3 months ago

phrazer commented 3 months ago

https://github.com/walkor/workerman/blob/e6162ad4c170113f62732d814a5fd4103436b565/src/Worker.php#L2314

may i ask, why do you disable encryption on the stream, if transport is ssl? or am I missing something? I see you enable it in tcp again, is it because of udp not supporting ssl?

https://www.php.net/manual/en/function.stream-socket-enable-crypto.php

walkor commented 3 months ago

The default SSL handshake process in PHP is blocking, so we have disabled it and will attempt to enable SSL handshake with stream_socket_enable_crypto only when there is data available on TCP.