cose451-asu / chat-server

Chatting server implemented by using Scala, Akka, Cats
0 stars 0 forks source link

Reproduce Failure(NOT an attack) : Connection Error io.netty.handler.codec.http2.Http2Exception: HTTP/2 client preface string missing or corrupt. Hex dump for received bytes: #1

Closed Guderian2nd closed 4 years ago

Guderian2nd commented 4 years ago

When the client attempts to connect to the server, the error in the title appears.

This appears to happen due to incorrect TLS setting on the server. The README file says you should set the environment variables CHAT_TLS_CERT_CHAIN_FILE and CHAT_TLS_KEY_FILE to enable TLS, what does this mean? What should they be set to?

AlanSynn commented 4 years ago

Hello, Guderian! Welcome and thank you for providing us the reproduce failure :smiley:

This appears to happen due to incorrect TLS setting on the server. The README file says you should set the environment variables CHAT_TLS_CERT_CHAIN_FILE and CHAT_TLS_KEY_FILE to enable TLS, what does this mean?

CHAT_TLS_CERT_CHAIN_FILE and CHAT_TLS_KEY_FILE can be generated by openssl. You can see the instructions on following https://gist.github.com/fntlnz/cf14feb5a46b2eda428e000157447309

After generating certs, you can set the paths on those env variables.

What should they be set to?

Generally, the absolute path to the env variables. e.g. export CHAT_TLS_KEY_FILE="path to cert file"

PS. If in case of error belongs to file permission, please check the authority of the certs.