After successfully using swoole_websocket_server to open the websocket service, I encountered a problem. Most of the web is https, especially when it comes to high security and the design of Internet finance and digital currency. At all times, https is required. At this time, the ws:// connection will be prohibited due to security issues.
Install swoole's openssl support. (Recommended Learning: SWOOLE Video Tutorial )
Re-compilation and installation of SWOOLE source code, plus --enable-openssl
1 2 3 4 |
|
## code ssl replaces ws
Server, compare the last code, make the following changes1 2 3 4 5 6 7 8 9 10 |
|
1 2 |
|
The above is the detailed content of Can swoole configure certificates?. For more information, please follow other related articles on the PHP Chinese website!