websocket icon indicating copy to clipboard operation
websocket copied to clipboard

Use SERVER with TLS cert e pk

Open AntonioRiccelli77 opened this issue 2 years ago • 0 comments

Hello, i'm need a simplest solution with y're websocket. I test and run the server but i don't understanding what is the correct use of the constructor.:

\vakata\websocket\Server('wss://0.0.0.0:8765','/etc/ssl/certs/ca.crt',null,'/etc/ssl/private/ca.key');

my ca.crt is selfsigned with: sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/ssl/private/ca.key -out /etc/ssl/certs/ca.crt

and it already worked and used in Apache2 HTTPS

but i obtain an error in Debian 12 bash terminal prompt when a web client connect to it

user@deb-vbox:~$ php wss.php PHP Warning: stream_socket_accept(): SSL operation failed with code 1. OpenSSL Error messages: error:0A000416:SSL routines::sslv3 alert certificate unknown in /home/user/vendor/vakata/websocket/src/Server.php on line 106 PHP Warning: stream_socket_accept(): Failed to enable crypto in /home/user/vendor/vakata/websocket/src/Server.php on line 106 PHP Warning: stream_socket_accept(): Accept failed: Success in /home/user/vendor/vakata/websocket/src/Server.php on line 106

AntonioRiccelli77 avatar Oct 10 '23 08:10 AntonioRiccelli77