[Play 1.2.5] HTTPS - failed to initialize server side ssl context

1,031 views
Skip to first unread message

Jeroen Van de Sande

unread,
Mar 18, 2013, 2:38:10 PM3/18/13
to play-fr...@googlegroups.com

Hi
I'm trying to enable https in my play application. I've follewed the documentation and added the next lines to my application.conf;
https.port=9443 
# X509 certificates 
certificate.key.file=conf/host.key
certificate.file=conf/host.cert
# In case your key file is password protected 
certificate.password=secret 

With both the key and cert file present in the conf folder. However when I rerun play and go to https://localhost:9443/ I get the following exception on my console:

Enter code here...mrt 18, 2013 7:31:01 PM org.jboss.netty.channel.socket.nio.NioServerSocketPipeli
neSink
WARNING: Failed to accept a connection.
java.lang.Error: Failed to initialize the server-side SSLContext
        at play.server.ssl.SslHttpServerContextFactory.<clinit>(SslHttpServerCon
textFactory.java:67)
        at play.server.ssl.SslHttpServerPipelineFactory.getPipeline(SslHttpServe
rPipelineFactory.java:29)
        at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink$Boss.r
egisterAcceptedChannel(NioServerSocketPipelineSink.java:274)
        at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink$Boss.r
un(NioServerSocketPipelineSink.java:239)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.FileNotFoundException: C:\Users\j\demo\conf\certificate.jks (The system cannot find the file specified
)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at play.server.ssl.SslHttpServerContextFactory.<clinit>(SslHttpServerCon
textFactory.java:53)
        ... 6 more

mrt 18, 2013 7:31:02 PM org.jboss.netty.channel.socket.nio.NioServerSocketPipeli
neSink
WARNING: Failed to accept a connection.
java.lang.NoClassDefFoundError: Could not initialize class play.server.ssl.SslHt
tpServerContextFactory
        at play.server.ssl.SslHttpServerPipelineFactory.getPipeline(SslHttpServe
rPipelineFactory.java:29)
        at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink$Boss.r
egisterAcceptedChannel(NioServerSocketPipelineSink.java:274)
        at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink$Boss.r
un(NioServerSocketPipelineSink.java:239)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
        at java.lang.Thread.run(Thread.java:722)


Adding a line for http (http.port=9000) doesn't seems to make a difference.

I completly followed the documentation and read other threads with the same problem, but I can't seem to fix this problem, even with all parameters set. the weirdest thing is that play looks for a jks keystore where it shouldn't do this as far as I understand?

christian sarnataro

unread,
Mar 19, 2013, 2:54:05 PM3/19/13
to play-fr...@googlegroups.com
Hi, i see this line in the stack trace:

java.io.FileNotFoundException: C:\Users\j\demo\conf\certificate.jks

Does this file exist?

Jeroen Van de Sande

unread,
Mar 20, 2013, 3:44:00 AM3/20/13
to play-fr...@googlegroups.com
Hi,

No this file is not present, scince I never said it had to look for a jks file and only specified a certificate and key file I (which is ok in the documentation) I would geuss it isn't needed to have both a certificate and a keystore.
Reply all
Reply to author
Forward
0 new messages