-
I suspect I'm doing some configuration wrong but I have this code
being piped into my uWS::SSLApp but whenever I try to connect to it using https://localhost or wss://localhost nothing seems to load. using http:// and ws:// works though so it seems the routes just aren't being configured with SSL. I just installed uwebsockets through vcpkg and just included the .h file. Is there some kind of preprocessor flag I need to set so that SSL works and isn't silently failing? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Check for error messages from the client. The client might be saying something like that the certificate's common name doesn't match. If you have trouble finding the client logs, try using this client instead: gnutls-cli -p 443 localhost It should say what the common name is. Then rerun that command using a domain name that matches the common name. If that works, then run the client you originally tried to use with that domain name instead of localhost. Now that you are using a different domain name in your client, ensure that the different domain name still refers to your uWebSockets server. If it does not refer to that, set up DNS to fix that or use /etc/hosts as a quick temporary workaround. |
Beta Was this translation helpful? Give feedback.
-
You need to build uSockets with SSL support, otherwise it will just default to regular TCP (that's a core feature - same business logic without any changes run on both TCP and TLS).
|
Beta Was this translation helpful? Give feedback.
You need to build uSockets with SSL support, otherwise it will just default to regular TCP (that's a core feature - same business logic without any changes run on both TCP and TLS).
https://github.com/microsoft/vcpkg/blob/master/ports/usockets/CMakeLists.txt#L25Looks like vcpkg has CMAKE_USE_OPENSSL you need to set during install.If you compile uSockets yourself, without vcpkg, it is LIBUS_USE_OPENSSL