HTTPS Server with Jetty Connector, SSLv3

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

HTTPS Server with Jetty Connector, SSLv3

cdu.anon
Trying to set up a Restlet HTTPS Server with a Jetty Connector.  here's what I have coded up:

Component home = new Component();

Server homeServer = new Server(
            home.getContext().createChildContext(),
            Protocol.HTTPS, port, home);
DefaultSslContextFactory sslContextFactory = new DefaultSslContextFactory();
sslContextFactory.setProtocol("SSL");
sslContextFactory.setKeyStorePath(certPath);
sslContextFactory.setKeyStorePassword(keystore_pwd);
sslContextFactory.setKeyStoreKeyPassword(key_pwd);
sslContextFactory.setKeyStoreType("JKS");
homeServer.getContext().getAttributes().put("sslContextFactory", sslContextFactory);


When starting up the server, I get the error below which I can't figure.  Any help please?  Thx very much in advance!

Apr 04, 2014 9:39:57 PM org.restlet.ext.jetty.HttpsServerHelper createConnector
WARNING: Unable to create the Jetty SSL context factory
java.lang.NullPointerException
        at java.security.Provider$ServiceKey.<init>(Provider.java:517)
        at java.security.Provider$ServiceKey.<init>(Provider.java:510)
        at java.security.Provider.getService(Provider.java:684)
        at sun.security.jca.ProviderList.getService(ProviderList.java:331)
        at sun.security.jca.GetInstance.getInstance(GetInstance.java:157)
        at javax.net.ssl.KeyManagerFactory.getInstance(KeyManagerFactory.java:139)
        at org.restlet.ext.ssl.DefaultSslContextFactory.createSslContext(DefaultSslContextFactory.java:325)
        at org.restlet.ext.jetty.internal.RestletSslContextFactory.<init>(RestletSslContextFactory.java:66)
        at org.restlet.ext.jetty.HttpsServerHelper.createConnector(HttpsServerHelper.java:106)
        at org.restlet.ext.jetty.JettyServerHelper.start(JettyServerHelper.java:393)
        at org.restlet.Server.start(Server.java:590)
        at org.restlet.Component.startServers(Component.java:611)
        at org.restlet.Component.start(Component.java:538)
[snip]

java.lang.NullPointerException
        at org.restlet.ext.jetty.JettyServerHelper.configure(JettyServerHelper.java:203)
        at org.restlet.ext.jetty.JettyServerHelper.start(JettyServerHelper.java:394)
        at org.restlet.Server.start(Server.java:590)
        at org.restlet.Component.startServers(Component.java:611)
        at org.restlet.Component.start(Component.java:538)
[snip]

Reply | Threaded
Open this post in threaded view
|

Re: HTTPS Server with Jetty Connector, SSLv3

Thierry Boileau-4
Hello,

for a quick workaround, set the "keyManagerAlgorithm" property:
        sslContextFactory.setKeyManagerAlgorithm("SunX509");

I think there is a bug here, because this should be the default value.

Best regards,
Thierry Boileau




2014-04-05 6:42 GMT+02:00 cdu <[hidden email]>:
Trying to set up a Restlet HTTPS Server with a Jetty Connector.  here's what
I have coded up:

Component home = new Component();

Server homeServer = new Server(
            home.getContext().createChildContext(),
            Protocol.HTTPS, port, home);
DefaultSslContextFactory sslContextFactory = new DefaultSslContextFactory();
sslContextFactory.setProtocol("SSL");
sslContextFactory.setKeyStorePath(certPath);
sslContextFactory.setKeyStorePassword(keystore_pwd);
sslContextFactory.setKeyStoreKeyPassword(key_pwd);
sslContextFactory.setKeyStoreType("JKS");
homeServer.getContext().getAttributes().put("sslContextFactory",
sslContextFactory);


When starting up the server, I get the error below which I can't figure.
Any help please?  Thx very much in advance!

Apr 04, 2014 9:39:57 PM org.restlet.ext.jetty.HttpsServerHelper
createConnector
WARNING: Unable to create the Jetty SSL context factory
java.lang.NullPointerException
        at java.security.Provider$ServiceKey.<init>(Provider.java:517)
        at java.security.Provider$ServiceKey.<init>(Provider.java:510)
        at java.security.Provider.getService(Provider.java:684)
        at sun.security.jca.ProviderList.getService(ProviderList.java:331)
        at sun.security.jca.GetInstance.getInstance(GetInstance.java:157)
        at javax.net.ssl.KeyManagerFactory.getInstance(KeyManagerFactory.java:139)
        at
org.restlet.ext.ssl.DefaultSslContextFactory.createSslContext(DefaultSslContextFactory.java:325)
        at
org.restlet.ext.jetty.internal.RestletSslContextFactory.<init>(RestletSslContextFactory.java:66)
        at
org.restlet.ext.jetty.HttpsServerHelper.createConnector(HttpsServerHelper.java:106)
        at
org.restlet.ext.jetty.JettyServerHelper.start(JettyServerHelper.java:393)
        at org.restlet.Server.start(Server.java:590)
        at org.restlet.Component.startServers(Component.java:611)
        at org.restlet.Component.start(Component.java:538)
[snip]

java.lang.NullPointerException
        at
org.restlet.ext.jetty.JettyServerHelper.configure(JettyServerHelper.java:203)
        at
org.restlet.ext.jetty.JettyServerHelper.start(JettyServerHelper.java:394)
        at org.restlet.Server.start(Server.java:590)
        at org.restlet.Component.startServers(Component.java:611)
        at org.restlet.Component.start(Component.java:538)
[snip]





--
View this message in context: http://restlet-discuss.1400322.n2.nabble.com/HTTPS-Server-with-Jetty-Connector-SSLv3-tp7579108.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3075894

Reply | Threaded
Open this post in threaded view
|

Re: HTTPS Server with Jetty Connector, SSLv3

Thierry Boileau-4
Best regards,
Thierry Boileau


2014-04-07 7:54 GMT+02:00 Thierry Boileau <[hidden email]>:
Hello,

for a quick workaround, set the "keyManagerAlgorithm" property:
        sslContextFactory.setKeyManagerAlgorithm("SunX509");

I think there is a bug here, because this should be the default value.

Best regards,
Thierry Boileau




2014-04-05 6:42 GMT+02:00 cdu <[hidden email]>:

Trying to set up a Restlet HTTPS Server with a Jetty Connector.  here's what
I have coded up:

Component home = new Component();

Server homeServer = new Server(
            home.getContext().createChildContext(),
            Protocol.HTTPS, port, home);
DefaultSslContextFactory sslContextFactory = new DefaultSslContextFactory();
sslContextFactory.setProtocol("SSL");
sslContextFactory.setKeyStorePath(certPath);
sslContextFactory.setKeyStorePassword(keystore_pwd);
sslContextFactory.setKeyStoreKeyPassword(key_pwd);
sslContextFactory.setKeyStoreType("JKS");
homeServer.getContext().getAttributes().put("sslContextFactory",
sslContextFactory);


When starting up the server, I get the error below which I can't figure.
Any help please?  Thx very much in advance!

Apr 04, 2014 9:39:57 PM org.restlet.ext.jetty.HttpsServerHelper
createConnector
WARNING: Unable to create the Jetty SSL context factory
java.lang.NullPointerException
        at java.security.Provider$ServiceKey.<init>(Provider.java:517)
        at java.security.Provider$ServiceKey.<init>(Provider.java:510)
        at java.security.Provider.getService(Provider.java:684)
        at sun.security.jca.ProviderList.getService(ProviderList.java:331)
        at sun.security.jca.GetInstance.getInstance(GetInstance.java:157)
        at javax.net.ssl.KeyManagerFactory.getInstance(KeyManagerFactory.java:139)
        at
org.restlet.ext.ssl.DefaultSslContextFactory.createSslContext(DefaultSslContextFactory.java:325)
        at
org.restlet.ext.jetty.internal.RestletSslContextFactory.<init>(RestletSslContextFactory.java:66)
        at
org.restlet.ext.jetty.HttpsServerHelper.createConnector(HttpsServerHelper.java:106)
        at
org.restlet.ext.jetty.JettyServerHelper.start(JettyServerHelper.java:393)
        at org.restlet.Server.start(Server.java:590)
        at org.restlet.Component.startServers(Component.java:611)
        at org.restlet.Component.start(Component.java:538)
[snip]

java.lang.NullPointerException
        at
org.restlet.ext.jetty.JettyServerHelper.configure(JettyServerHelper.java:203)
        at
org.restlet.ext.jetty.JettyServerHelper.start(JettyServerHelper.java:394)
        at org.restlet.Server.start(Server.java:590)
        at org.restlet.Component.startServers(Component.java:611)
        at org.restlet.Component.start(Component.java:538)
[snip]





--
View this message in context: http://restlet-discuss.1400322.n2.nabble.com/HTTPS-Server-with-Jetty-Connector-SSLv3-tp7579108.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3075894


Reply | Threaded
Open this post in threaded view
|

RE: Re: HTTPS Server with Jetty Connector, SSLv3

Thierry Boileau-4
Hello,

thanks a lot for reporting this issue. I've synchronized the code and javadocs.

Best regards,
Thierry Boileau

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3077353