SSL problem in SFS

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
joveem
Posts: 2
Joined: 26 Apr 2021, 08:33
Location: Rio de Janeiro - RJ - Brazil

SSL problem in SFS

Postby joveem » 26 Apr 2021, 08:59

I took on a project in production that already reaches a large number of users, I understand online communication but I am starting to understand SFS now.

The game is multiplatform made in Unity (Android, iOs and WebGL) and the SFS server does not seem to have SSL.

Both Android and iOs work well, but WebGL only works when it is accessed over HTTP (not HTTPS) <-> SFS: <HTTP / WS port>

When I try any of these combinations:

HTTP <-> SFS: <HTTPS / WSS port>
HTTPS <-> SFS: <HTTP / WS port>
HTTPS <-> SFS: <HTTPS / WSS port>

we have the connection rejected

Would putting an SSL certificate on the server solve all the problems? For now our only goal is to make the WebGL front end work with SSL



examples of error logs :

Code: Select all

An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
SecurityError: The operation is insecure.

Code: Select all

exception thrown: SecurityError: The operation is insecure.,_SocketCreate@blob:https://domain.domain.com/77b3d76d-2b55-4dab-8a01-1b8c9fa53a20:3679:11
_WebSocketHelper_SocketCreate_m5AA1391D0CFAF2A1A22C4C20475FD22964DAA223@blob:https://domain.domain.com/77b3d76d-2b55-4dab-8a01-1b8c9fa53a20 line 1169 > WebAssembly.instantiate:wasm-function[72337]:0x162ef9d
_WebSocketHelper_Connect_mD94AC905DFE30AA789ED9C60007B95F61C78EC6D@blob:https://domain.domain.com/77b3d76d-2b55-4dab-8a01-1b8c9fa53a20 line 1169 > WebAssembly.instantiate:wasm-function[72344]:0x162f085
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SSL problem in SFS

Postby Lapo » 26 Apr 2021, 14:38

Hi,
these are not valid options:

HTTP <-> SFS: <HTTPS / WSS port>

You can't use HTTP client side by pointing to a server HTTPS/WSS port

HTTPS <-> SFS: <HTTP / WS port>

Same here, this is a protocol mismatch, as above.

HTTPS <-> SFS: <HTTPS / WSS port>

This will work only if you have a valid SSL certificate issued by a Certificate Authority (CA)

Would putting an SSL certificate on the server solve all the problems?

Yes indeed

More info on how to setup an SSL certificate can be found here:
http://docs2x.smartfoxserver.com/Gettin ... yptography

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Google [Bot] and 53 guests