SSL encryption JKS file

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

Moderators: Lapo, Bax

Post Reply
alexcy32
Posts: 22
Joined: 14 May 2013, 16:48

SSL encryption JKS file

Post by alexcy32 »

I have managed to create a .pfx file (from Godaddy's SSL certificate using EXPORT command in IIS). Then I create the .jks file as per the instructions on http://docs2x.smartfoxserver.com/Gettin ... yptography

Then I copy the .jks file and edit the .ini file to reflect the new .jks file and password (which I choose during the creation of the .jks file).

After doing the above and restarting the server it never starts again. The following is in the log file WARN | SFS2X ShutdownHook | v2.core.SFSShutdownHook (If I try to start the sfs-2x service manually it just STOPS by itself and does not start).

If I replace the ssl.ini with the original one that is unmodified then the SFS starts fine.

Any ideas as to why? This is a fresh SFS install, no extensions etc.

Thank you
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SSL encryption JKS file

Post by Lapo »

Hi,
there should be more lines in the log files when the server starts up again.
Can you copy/paste them here. The logs are in SFS2X/logs/smartfox.log

thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
alexcy32
Posts: 22
Joined: 14 May 2013, 16:48

Re: SSL encryption JKS file

Post by alexcy32 »

Here is a fresh copy of the log. The 1st start of the SFS it failed to start (17:31pm). Then I replaced the SSL.INI and I restarted again and it worked ok (17:34pm) -- I have the server on INFO mode when it comes to logging (not DEBUG fyi)


05 Nov 2015 | 17:31:24,856 | INFO | main | smartfoxserver.v2.SmartFoxServer | | Boot sequence starts...
05 Nov 2015 | 17:31:26,341 | INFO | main | v2.core.SFSEventManager | | AnonymousService-1 initialized
05 Nov 2015 | 17:31:26,419 | INFO | main | vfs.impl.DefaultFileReplicator | | Using "C:\Windows\TEMP\vfs_cache" as temporary files store.
05 Nov 2015 | 17:31:26,669 | INFO | main | smartfoxserver.v2.SmartFoxServer | | License loaded:

==========================================
LICENSE DETAILS
------------------------------------------
Type : Community Edition
Max users : 100
==========================================

05 Nov 2015 | 17:31:26,669 | INFO | main | entities.managers.SFSBannedUserStorage | | BanUserStorage initialized
05 Nov 2015 | 17:31:26,716 | INFO | main | entities.managers.SFSBannedUserManager | | BanUser data loaded: 0 records.
05 Nov 2015 | 17:31:26,731 | INFO | main | smartfoxserver.v2.SmartFoxServer | | Protocol Type is: BINARY
05 Nov 2015 | 17:31:26,747 | INFO | main | v2.config.DefaultConfigLoader | | Loading: zones\BasicExamples.zone.xml
05 Nov 2015 | 17:31:26,794 | INFO | main | entities.managers.SFSZoneManager | |

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
>> Zone: BasicExamples
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

05 Nov 2015 | 17:31:26,903 | INFO | main | entities.managers.SFSRoomManager | | Room created: { Zone: BasicExamples }, [ Room: The Lobby, Id: 0, Group: default, isGame: false ]
05 Nov 2015 | 17:31:26,919 | INFO | main | entities.managers.SFSRoomManager | | Room created: { Zone: --=={{{ AdminZone }}}==-- }, [ Room: AdminRoom, Id: 1, Group: default, isGame: false ]
05 Nov 2015 | 17:31:26,935 | INFO | main | v2.core.AdminToolService | | AdminTool Service started
05 Nov 2015 | 17:31:27,368 | INFO | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer | | Listening Sockets: { 0.0.0.0:9933, (Tcp) }
05 Nov 2015 | 17:31:27,370 | INFO | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer | |
_____ _____ _____ ___ __ __
| __| __| __| |_ | | |
|__ | __|__ | | _|- -|
|_____|__| |_____| |___|__|__|
_____ _____ _____ ____ __ __
| __ | __| _ | \| | |
| -| __| | | |_ _|
|__|__|_____|__|__|____/ |_|
[ 2.10.0 ]

05 Nov 2015 | 17:31:27,370 | INFO | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer | | SmartFoxServer 2X (2.10.0) READY!
05 Nov 2015 | 17:31:27,516 | WARN | SFS2X ShutdownHook | v2.core.SFSShutdownHook | | SFS2X is shutting down. The process may take a few seconds...
05 Nov 2015 | 17:31:27,517 | INFO | Thread-1 | entities.managers.SFSZoneManager | | BuddyList saveAll...
05 Nov 2015 | 17:31:27,525 | INFO | Thread-2 | entities.managers.SFSBannedUserManager | | BanUser data saved.
05 Nov 2015 | 17:34:32,112 | INFO | main | smartfoxserver.v2.SmartFoxServer | | Boot sequence starts...
05 Nov 2015 | 17:34:33,769 | INFO | main | v2.core.SFSEventManager | | AnonymousService-1 initialized
05 Nov 2015 | 17:34:33,862 | INFO | main | vfs.impl.DefaultFileReplicator | | Using "C:\Windows\TEMP\vfs_cache" as temporary files store.
05 Nov 2015 | 17:34:34,081 | INFO | main | smartfoxserver.v2.SmartFoxServer | | License loaded:

==========================================
LICENSE DETAILS
------------------------------------------
Type : Community Edition
Max users : 100
==========================================

05 Nov 2015 | 17:34:34,097 | INFO | main | entities.managers.SFSBannedUserStorage | | BanUserStorage initialized
05 Nov 2015 | 17:34:34,128 | INFO | main | entities.managers.SFSBannedUserManager | | BanUser data loaded: 0 records.
05 Nov 2015 | 17:34:34,144 | INFO | main | smartfoxserver.v2.SmartFoxServer | | Protocol Type is: BINARY
05 Nov 2015 | 17:34:34,159 | INFO | main | v2.config.DefaultConfigLoader | | Loading: zones\BasicExamples.zone.xml
05 Nov 2015 | 17:34:34,206 | INFO | main | entities.managers.SFSZoneManager | |

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
>> Zone: BasicExamples
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

05 Nov 2015 | 17:34:34,300 | INFO | main | entities.managers.SFSRoomManager | | Room created: { Zone: BasicExamples }, [ Room: The Lobby, Id: 0, Group: default, isGame: false ]
05 Nov 2015 | 17:34:34,331 | INFO | main | entities.managers.SFSRoomManager | | Room created: { Zone: --=={{{ AdminZone }}}==-- }, [ Room: AdminRoom, Id: 1, Group: default, isGame: false ]
05 Nov 2015 | 17:34:34,363 | INFO | main | v2.core.AdminToolService | | AdminTool Service started
05 Nov 2015 | 17:34:34,675 | INFO | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer | | Listening Sockets: { 0.0.0.0:9933, (Tcp) }
05 Nov 2015 | 17:34:34,675 | INFO | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer | |
_____ _____ _____ ___ __ __
| __| __| __| |_ | | |
|__ | __|__ | | _|- -|
|_____|__| |_____| |___|__|__|
_____ _____ _____ ____ __ __
| __ | __| _ | \| | |
| -| __| | | |_ _|
|__|__|_____|__|__|____/ |_|
[ 2.10.0 ]

05 Nov 2015 | 17:34:34,675 | INFO | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer | | SmartFoxServer 2X (2.10.0) READY!
05 Nov 2015 | 17:34:37,134 | WARN | main | util.resource.FileResource | | bad alias for C:\Program Files\SmartFoxServer_2X\SFS2X\.\:lib\*:lib\jetty\lib\*:extensions\__lib__\*: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
05 Nov 2015 | 17:34:37,332 | WARN | main | util.resource.FileResource | | bad alias for C:\Program Files\SmartFoxServer_2X\SFS2X\.\:lib\*:lib\jetty\lib\*:extensions\__lib__\*: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
05 Nov 2015 | 17:34:37,464 | WARN | main | util.resource.FileResource | | bad alias for C:\Program Files\SmartFoxServer_2X\SFS2X\.\:lib\*:lib\jetty\lib\*:extensions\__lib__\*: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
05 Nov 2015 | 17:34:38,452 | WARN | main | util.resource.FileResource | | bad alias for C:\Program Files\SmartFoxServer_2X\SFS2X\.\:lib\*:lib\jetty\lib\*:extensions\__lib__\*: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
05 Nov 2015 | 17:34:38,712 | INFO | main | bluebox.v3.SessionFilter | | BlueBox-2X Service (3.0.2) READY.
05 Nov 2015 | 17:34:38,720 | WARN | main | util.resource.FileResource | | bad alias for C:\Program Files\SmartFoxServer_2X\SFS2X\.\:lib\*:lib\jetty\lib\*:extensions\__lib__\*: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
05 Nov 2015 | 17:34:40,894 | WARN | Scanner-0 | util.resource.FileResource | | bad alias for C:\Program Files\SmartFoxServer_2X\SFS2X\.\:lib\*:lib\jetty\lib\*:extensions\__lib__\*: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
05 Nov 2015 | 17:34:41,065 | WARN | Scanner-0 | util.resource.FileResource | | bad alias for C:\Program Files\SmartFoxServer_2X\SFS2X\.\:lib\*:lib\jetty\lib\*:extensions\__lib__\*: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SSL encryption JKS file

Post by Lapo »

Actually it doesn't seem that the 1st start didn't work. It looks like there's no errors and the server has outputted the "Server Ready" log message, which indicates that it is running.

Were you not able to connect or something like that?

Can you show me the difference between the two .ini files, by the way?
Lapo
--
gotoAndPlay()
...addicted to flash games
alexcy32
Posts: 22
Joined: 14 May 2013, 16:48

Re: SSL encryption JKS file

Post by alexcy32 »

On the 1st instance for sure SFS was not running. I could not connect to Adminzone(I also tried through the browser at https//:<your-host>:<ssl-port> and it wasn't working also, and the sfs service cannot start).. Isn't this line in the log file imply that the SFS shut down after restart:
05 Nov 2015 | 17:31:27,516 | WARN | SFS2X ShutdownHook | v2.core.SFSShutdownHook | | SFS2X is shutting down. The process may take a few seconds...

The 2nd ssl.ini that I use and I am having issues has this code:
#
# Initialize module ssl
#
--module=ssl
## SSL Keystore Configuration
# define the port to use for secure redirection
jetty.secure.port=8443

# Setup a demonstration keystore and truststore
jetty.keystore=etc/test2.jks
jetty.truststore=etc/test2.jks

# Set the demonstration passwords.
# Note that OBF passwords are not secure, just protected from casual observation
# See http://www.eclipse.org/jetty/documentat ... words.html
jetty.keystore.password=123456
jetty.keymanager.password=123456
jetty.truststore.password=123456

The other SSL.ini is the original one that is included in the installation.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SSL encryption JKS file

Post by Lapo »

The .ini file looks fine, no problem there. So if the problem is persisting I'd be suspicious of the .jks file.

You could verify its integrity by running this command:

Code: Select all

keytool -list -v -keystore keystore.jks
Other than that, you could send the jks file file to us via email (support@...) and we can try it over here.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
alexcy32
Posts: 22
Joined: 14 May 2013, 16:48

Re: SSL encryption JKS file

Post by alexcy32 »

I tried to test the integrity of it and it looks fine. If it's not too much trouble I will send the JKS to your email and please have a look at it.. It's been bugging me for quite some time now and can't fix it. I will reference this thread in the email. Sending it now. Thank you
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SSL encryption JKS file

Post by Lapo »

No problem, thanks. We'll take a look and get back to you.
Lapo
--
gotoAndPlay()
...addicted to flash games
alexcy32
Posts: 22
Joined: 14 May 2013, 16:48

Re: SSL encryption JKS file

Post by alexcy32 »

Is there a way to get more error messages as to why SFS does not start? I tried changing it to DEBUG mode but the logs remain the same. Basically the SFS shuts down as soon as it starts:

06 Nov 2015 | 09:14:25,210 | INFO | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer | | SmartFoxServer 2X (2.10.0) READY!
06 Nov 2015 | 09:14:25,334 | INFO | Thread-1 | entities.managers.SFSZoneManager | | BuddyList saveAll...
06 Nov 2015 | 09:14:25,341 | WARN | SFS2X ShutdownHook | v2.core.SFSShutdownHook | | SFS2X is shutting down. The process may take a few seconds...

And again as soon as I replace the SSL.ini everything works OK. Can you provide me a different test jks to try out perhaps?

Thank you
alexcy32
Posts: 22
Joined: 14 May 2013, 16:48

Re: SSL encryption JKS file

Post by alexcy32 »

It seems the UTF-8 encoding was wrong.. Trying again a fresh one.. Will get back to you..

Thank you
Last edited by alexcy32 on 06 Nov 2015, 09:15, edited 1 time in total.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SSL encryption JKS file

Post by Lapo »

I've already replied via email... let's keep the conversation there.
Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply