-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSL Web Socket Error: stream truncated #915
Comments
Try using different browsers. I have noticed that some browsers work and others don't. I believe it has something to do with the self-signed certificates that the beast examples use. |
Anyway "stream truncated" means that the other end closed the connection abruptly. Chrome does this often, it usually never performs the SSL closing handshake. Google says that behavior leads to better performance. |
I try to open in three different browsers, results is following: Firefox: Error: tlsv1 alert unknown ca All errors occurs during ws.accept(). Which browser do you use for this examples, or this problem specific for different machine and OS? |
Microsoft Edge browser worked for me. Chrome and Firefox did not. |
The problem was connected with self signed certificate. All works fine if in Firefox I add my server (localhost:8080) to Server Exception in Certificate Manager. And also I have tried to run ssl server with my certificate which is not self signed and which has correct Common Name (CN) = localhost and has correct Subj Alt Name = localhost. With my certificate SSL Web Sockets server works correctly in all browsers. Many thanks for your quick replies. |
Glad to hear that you got it sorted! SSL certificates are a hassle... |
Hello.
I investigate boost.beast library to host web socket services in my c++ app.
I try with two examples from beast library: websocket_server_sync.cpp and websocket_server_sync_ssl.cpp.
Without SSL web socket works correctly.
But if I run SSL web socket I get following error:
Error: stream truncated
It occurs during ws.accept().
Could you please explain what the possible reason of such behavior?
BOOST_BEAST_VERSION 124
As client I use simple JavaScript:
<script> var socket = new WebSocket("wss://127.0.0.1:8080"); socket.onopen = function() { socket.send("HelloWS"); }; socket.onclose = function(event) {}; socket.onmessage = function(event) {}; socket.onerror = function(error) {}; </script>The text was updated successfully, but these errors were encountered: