WebRTC throws error when used as web page

Godot Version

4.2.2.stable

Question

I want to put a multiplayer game on my web page, so I started to work with WebSockets and WebRTC using the official WebRTC library. Running the project as debug or as a native Windows export, the program connects succesfully to my dedicated linux server. But the web version nether works as remote-debug for the browser nor as HTML5 export. It just shows the loading page and throws dozens of errors in the browser console. In the Godot console I just get one error when using the remote debug:
No suitable library found for GDExtension: res://godot-extension-4.1-webrtc/webrtc/webrtc.gdextension. Possible feature flags for your platform: web, s3tc, wasm32, template, debug, template_debug

So I tried to delete the extension. This time the project loaded but only to the point where the client connects to the server.
Browser error:
Unable to connect to WebSocketServer
Server errors:
thirdparty/mbedtls/library/ssl_msg.c:4704: is a fatal alert message (msg 46)
thirdparty/mbedtls/library/ssl_msg.c:3846: mbedtls_ssl_handle_message_type() returned -30592 (-0x7780)
thirdparty/mbedtls/library/ssl_srv.c:3996: mbedtls_ssl_read_record() returned -30592 (-0x7780)
thirdparty/mbedtls/library/ssl_msg.c:5223: mbedtls_ssl_handshake() returned -30592 (-0x7780)
mbedtls error: returned -0x7780

The projects uses wss not ws. I generated the certificate and the key with Godot.

Thank you for taking your time to reading this and helping if you can.

I haven’t used WebRTC on html so can’t say much.

However, it does seem there could be something wrong with your ssl setup. Maybe first try to get ws working and secure it after? Removes one layer of complexity.

Without SSL it works when using the browser remote-debug. The problem is, that I want to upload the game to a https website and therefore need wss.

What’s confusing me is the fact that native windows exports and godot debug sessions work well, only the browser remote-debug and the HTML5 export throw errors.

Did you try the non-ssl version on the server? Just making sure that works too.

Also, how are you hosting the server? Just running the godot executable? For example CarRover or Coolify can make managing ssl much easier. You can also tie them into the github CI/CD pipeline so your commits automatically update the server instance.

To connenct without SSL the server doesn’t require a secure connection, so yes, I tried the non-ssl version on the server. I’ve tested the client both with the Godot remote-debug for HTML5 in browsers and HTML5 export to upload it to my web page.

How I execute the server program: I’m using a virtual server (linux) on which I also hoste my web page. I start the server program via terminal.
Are the things you mentioned applications for a server or external products for web hosting?