Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] [jetty-dev] Secure websockets

Looks like your env got caught in a TLS / next proto quirk.
I'm guessing you tried to access this jetty server from a current and updated browser.

Can you upgrade to 9.2.17 at least?

When it comes to SSL (now called TLS) you *have to* stay up to date.
The introduction of HTTP/2 in browsers is mandating this.
The fundamentals and minimums of SSL/TLS are being updated at a much higher frequency.
And your 9.2.2 release is before a large chunk of these updated minimums.


Joakim Erdfelt / joakim@xxxxxxxxxxx

On Mon, Aug 10, 2015 at 6:08 AM, dhiraj prajapati <dhirajpraj@xxxxxxxxx> wrote:
Hi, 
I am trying to write a server which can establish secure websocket connections, using embedded jetty 9.2.2
Below is my code snippet:

               Server server;
WebSocketHandler wsHandler = new WebSocketHandler()
{
@Override
public void configure( WebSocketServletFactory webSocketServletFactory )
{
webSocketServletFactory.register( WebSocketProxyHandler.class  );
}
};
QueuedThreadPool threadPool = new QueuedThreadPool( mainConfig.getIntValue( "jetty.server.threadpool", 100 ) );
server = new Server( threadPool );
server.manage( threadPool );
SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setKeyStorePath("/home/deploy/cs/conf/keystore");
sslContextFactory.setKeyStorePassword("games24x7");
sslContextFactory.setKeyManagerPassword("games24x7");
sslContextFactory.setTrustStorePath("/home/deploy/cs/conf/keystore");
       sslContextFactory.setTrustStorePassword("games24x7");
ServerConnector sc = new ServerConnector( server, new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()) );
sc.setPort( mainConfig.getIntValue( "proxy.jetty.listenport" ) );
server.setConnectors( new Connector[] { sc } );
// server = new
// Server(mainConfig.getIntValue("proxy.jetty.listenport"));
server.setHandler( wsHandler );
try
{
server.start();
logger.debug( "Websocket Server started" );
server.join();

}
catch( Exception e )
{
logger.error( "Error in jetty startup", e );
}


I am getting the below exception:
10-Aug-2015 17:44:01.893 41539 [qtp980326486-336-selector-ServerConnectorManager@5520f675/0] DEBUG org.eclipse.jetty.io.SelectorManager  -  
java.lang.NullPointerException
        at org.eclipse.jetty.server.SslConnectionFactory.newConnection(SslConnectionFactory.java:86)
        at org.eclipse.jetty.server.ServerConnector$ServerConnectorManager.newConnection(ServerConnector.java:462)
        at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:676)
        at org.eclipse.jetty.io.SelectorManager$ManagedSelector.access$700(SelectorManager.java:353)
        at org.eclipse.jetty.io.SelectorManager$ManagedSelector$Accept.run(SelectorManager.java:828)
        at org.eclipse.jetty.io.SelectorManager$ManagedSelector.runChange(SelectorManager.java:469)
        at org.eclipse.jetty.io.SelectorManager$ManagedSelector.runChanges(SelectorManager.java:460)
        at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:518)
        at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:488)
        at org.eclipse.jetty.util.thread.NonBlockingThread.run(NonBlockingThread.java:52)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:606)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:535)
        at java.lang.Thread.run(Thread.java:745)

Is there anything wrong in my code?


Thanks in advance

_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev


Back to the top