Page 1 of 1

Problem with keystore and ssl

PostPosted: Thu May 03, 2018 11:17 am
by swingman
Hi, I'm running

Code: Select all
Server Information
Servoy version 8.2.2 -releaseNumber 3107
Port used by RMI Registry: 1099
Repository version 49

JVM Information HotSpot(TM) 64-Bit Server VM
java.version=9.0.1 mode
java.vm.vendor=Oracle Corporation

Operating System Information OS X

I have created a keystore inside


by running the following commands in the conf directory

Code: Select all
keytool -import -alias root -keystore     servoy.keystore -trustcacerts -file gdroot-g2.crt
keytool -import -alias intermed -keystore servoy.keystore -trustcacerts -file gdig2.crt
keytool -import -alias servoy -keystore   servoy.keystore -trustcacerts -file <my_ssl_certificate_name_here>.crt

specifying a keystore password, lets call it <password>.

I have added an extra bit to server.xml

Code: Select all
<Connector port="8084"

and added the following

Code: Select all
      <web-resource-name>Automatic SLL Forwarding</web-resource-name>



then I go to the Network Settings in Servoy Server admin to try to set

SocketFactory.SSLKeystorePath = server/conf/servoy.keystore
SocketFactory.SSLKeystorePassphrase = <password>

Whatever I set them to I either get a message that
the keystore password was wrong or I get a green message that SSL initialised OK,
but when I look in the logs the keystore was not found and you can no longer launch Smart Clients, the fail to load with hand-shake errors.

I'm not trying to sign the code with a code-signing certificate, I just want to force all the traffic to servoy-admin and smart-clients over https.

Any ideas what I'm doing wrong?

Re: Problem with keystore and ssl

PostPosted: Fri May 04, 2018 10:28 am
by swingman

I tried adding a new keystore with a self-signed certificate. I did this for my Servoy Developer, so my developer admin page is now working fine on https (after accepting the warning from the browser about the self-signed certificate).

Doing the same on the server,I had to add the keystore password on the Servoy admin page, edit the servoy.preferences file to make the keystore password clear text so it is re-encrypted using the new key. After restarting the server, I get a green message about "SSL initialised OK", no errors in the logs.

Then I edit server.xml (adding the https connector) and web.xml (redirect to https, which works fine). Restarted again.

But if I launch a client it gets stuck on launch:

Code: Select all peer not authenticated
   at com.sebster.tunnel.impl.cb.a(
   at com.sebster.tunnel.DelegatingTunnelClient.connect(
   at com.sebster.tunnel.impl.le.<init>(
   at com.sebster.tunnel.multiplexer.rmi.ClientMultiplexedRmiSocketFactoryProvider$1.<init>(
   at com.sebster.tunnel.multiplexer.rmi.ClientMultiplexedRmiSocketFactoryProvider.<init>(
   at com.sebster.tunnel.multiplexer.rmi.ClientMultiplexedRmiSocketFactoryProvider.<init>(
   at com.servoy.j2db.server.rmi.tunnel.ClientTunnelRMISocketFactoryFactory$RmiSocketFactoryProvider.<init>(
   at com.servoy.j2db.server.rmi.tunnel.ClientTunnelRMISocketFactoryFactory$RmiSocketFactoryProvider.<init>(
   at com.servoy.j2db.server.rmi.tunnel.ClientTunnelRMISocketFactoryFactory.createFactoryProvider(
   at com.servoy.j2db.server.rmi.tunnel.ClientTunnelRMISocketFactoryFactory.<init>(
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
   at java.lang.reflect.Constructor.newInstance(
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(
   at java.lang.reflect.Method.invoke(
   at com.sun.javaws.Launcher.executeApplication(Unknown Source)
   at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
   at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
   at Source)

Any ideas?

Re: Problem with keystore and ssl

PostPosted: Fri May 04, 2018 10:57 am
by swingman
Do I need to add the certificate or the root and intermediate certificate to the cacerts inside of my java installation (Java 9.0.1)?

As mentioned here ... enticated/

Re: Problem with keystore and ssl

PostPosted: Mon Jun 04, 2018 12:09 pm
by swingman
Have anybody done this successfully and can shed light on how this is done?