Page 1 of 1

MalformedInputException when using port 443

Posted: 10 Sep 2012, 21:16
by sneedsquatch
Please be aware that if you follow the recommendation found in the documentation and configure SmartFoxServer to listen on port 443, you are more likely to see the mysterious "MalformedInputException" in your server log file. This can be found at http://www.smartfoxserver.com/docs/1x/, expand "The BlueBox", click "BlueBox f.a.q.", and scroll down to "What's the recommend SmartFoxServer/BlueBox port configuration?".

We were easily able to reproduce the behavior that causes the log message:
1) Configure SmartFoxServer to listen on port 443 for incoming socket traffic and start it up.
2) In any web browser (we used Firefox), type "https://" and the IP address (or host) of your game server, then press enter.
3) Check your server log file - if you do not see the "MalformedInputException" message, repeat the submission by holding down F5 for a few seconds.

Firefox will show a SSL error such as "Secure Connection Failed" due to the SSL handshake failing. This is expected because SFS is obviously not using SSL, and is likely sending back unexpected data for the handshake request. Similarly, the MalformedInputException on the server side makes sense in this context, because the SSL handshake is violating the character based protocol used by SFS.

This is obviously not a bug with SFS, but I do think it's worth sharing because it could save others a lot of time if they are trying to track down the cause.
The real world scenarios where the above situation could happen are outside the scope of this topic.

Re: MalformedInputException when using port 443

Posted: 11 Sep 2012, 07:10
by Lapo
Hi, thanks for sharing, it makes perfect sense.
Again I would like to underline that the exception does not cause harm to the server, it is just a signal that a client is not using the SFS protocol. Using port 443 or 80 to provide the best connectivity for clients is highly recommended.

Cheers.