UE5 websocket WSS problem

i have folow the first part of this tutorial “How to Use WebSockets in Unreal Engine - YouTube
for testing and i want conect my game client to a nodejs server with WSS
Websocket Secure and after making the changes on the server
when if i conected with “wss://” in place of “ws://” is not functional
I created a certificate for the occasion with “letsencrypt” is NOT a self signed certificate
and with the browser I have a connections to the server

	const FString ServerURL = TEXT("wss://manor.servehttp.com:4443");
	const FString ServerProtocol = TEXT("wss"); 

	WebSocket = FWebSocketsModule::Get().CreateWebSocket(ServerURL);
1 Like

hi, I met the same problem. Do you solve?
How to add certificate when creating wss conection?

I’m not actually trying the same thing as you, but I might have stumbled uppon the answer. Maybe not, I don’t know.

Here, they talk about a variable for the used server protocoll, which is given to the CreateWebSocket function:

const FString ServerURL = TEXT(“ws://127.0.0.1:3000/”); // Your server URL. You can use ws, wss or wss+insecure.
const FString ServerProtocol = TEXT(“ws”); // The WebServer protocol you want to use.

TSharedPtr Socket = FWebSocketsModule::Get().CreateWebSocket(ServerURL, ServerProtocol);

Maybe if you set this, then it works.

You should add in BaseEngine.ini file:


[LwsWebSocket]
bDisableCertValidation=true

1 Like

Very good, it solved our problem