statianzo / Fleck

C# Websocket Implementation
MIT License
2.25k stars 583 forks source link

Fleck is not sending "server hello" in VM without internet #309

Closed rhalim closed 3 years ago

rhalim commented 3 years ago

We are using Fleck to create a secure websocket server program. The program works fine in my PC, but when we deploy it in a a locked down VM that does not have any internet connection, the application layer is not getting socket accept. From wireshark, the VM received a "client hello" from the web socket client, but there is no "server hello" back to client.

To prove that it is not any network issue, we extract the cert and private key from the pfx file and use openssl s_server to simulate an SSL server. With openssl, wireshark can see full SSL handshake, but with fleck, we are not seeing "server hello" back to client.

What may cause Fleck to not respond to the SSL handshake? Does it need a public connection to Internet to work?

Thank you!

statianzo commented 3 years ago

A public internet connection isn't a requirement.

A couple other things you could test

What OS are you running in? What .NET runtime? Does Fleck produce any logs? Try setting FleckLog.Level = LogLevel.Debug to see more details.

What SSL version are you using? Test setting webSocketServer.EnabledSslProtocols = SslProtocol.Tls12

rhalim commented 3 years ago

Thank you statianzo for your reply.

OS is Windows server 2012. .NET is 5.0 I believe. We enabled log and found an exception "The client and server cannot communicate, because they do not possess a common algorithm." We will try webSocketServer.EnabledSslProtocols = SslProtocol.Tls12 and update result here. Thanks again.

rhalim commented 3 years ago

Update: after setting tls12 in both server and client, it works fine in the locked down VM.

Thank you statianzo.