SmartFox v2.16.3 - [SFS ERROR][WebSocketLayer] Connection Error: Abnormal Connection

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

Moderators: Lapo, Bax

pseudo_7_juego
Posts: 2
Joined: 07 Jan 2021, 20:00

SmartFox v2.16.3 - [SFS ERROR][WebSocketLayer] Connection Error: Abnormal Connection

Postby pseudo_7_juego » 07 Jan 2021, 20:10

Hi guys. I am facing this issue while connecting to SmartFox Server 2X using WebSockets(Secure) in WebGL build. I'm able to connect using normal web-sockets but this issue I'm not able to debug. :(

I have created a build back in Sept 2020 using the same server and same settings(Unity version, SmartFox Client version[1.7.12], and SFS version 2.14) and it was working fine before. Now in the new phase we thought of updating it to the latest patch (as flash is not supported anymore) but we are facing this error.
Any help on this will be appreciated a lot. Thanks in advance.

PS. I'm using WSS_BIN for WebSockets.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SmartFox v2.16.3 - [SFS ERROR][WebSocketLayer] Connection Error: Abnormal Connection

Postby Lapo » 08 Jan 2021, 10:39

Hi,
supposing you have already deployed the SSL certificate following the docs here:
http://docs2x.smartfoxserver.com/Gettin ... yptography

I would recommend starting the server once from the command line via ./sfs2x.sh (linux) or sfs2x.bat (windows) and check that no errors appear during the server boot.

If that's the case you should then launch one client and connect to the server and report back what client side and server side errors are you getting during the connection.

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
pseudo_7_juego
Posts: 2
Joined: 07 Jan 2021, 20:00

Re: SmartFox v2.16.3 - [SFS ERROR][WebSocketLayer] Connection Error: Abnormal Connection

Postby pseudo_7_juego » 08 Jan 2021, 15:02

Thanks a ton Lapo for your quick reply and insight into the problem.
I was in-fact getting an error while starting the Server from SSH via 'sh sfs2x.sh' but not when I ran 'sfs2x-service start/restart'.

It was giving Connector Error [Http1/1-8443] which was caused by jsse.alias_no_key_entry error.

I was creating JKS file using a .crt and .key file using the following manner (which resulted in a JKS file of 2KB).

Code: Select all

keytool -import -alias alias -file {certificate_file}.crt -keypass {key_file}.key -keystore {exported_jks}.jks -storepass {keystore_password}


Instead I used the following command to create JKS which is a 2 way process and resulted in JKS of 7KB. (Now I realised I should have gone with one is mentioned on SmartFox docs... :oops: )

Code: Select all

openssl pkcs12 -export -in {certificate_file}.crt -inkey {key_file}.key -out {pkcs12_file}.p12

keytool -importkeystore -srckeystore {pkcs12_file}.p12 \
        -srcstoretype PKCS12 \
        -destkeystore {exported_jks}.jks \
        -deststoretype JKS


Again, thanks a lot for quick assistance.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SmartFox v2.16.3 - [SFS ERROR][WebSocketLayer] Connection Error: Abnormal Connection

Postby Lapo » 11 Jan 2021, 10:18

No problem. Glad you solved the issue :)

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 34 guests