Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » jetty websocket certificate validation
jetty websocket certificate validation [message #1781108] Thu, 01 February 2018 13:38
venky m is currently offline venky mFriend
Messages: 2
Registered: February 2018
Junior Member

We have a Websocket application where server code is deployed in Tomcat and client is in Jetty.

The issue we have is when a certificate is expired on Server, client is still connecting to server and communicating without any issues, we want to validate the server certificate expiry and stop the client from connecting to it.Can you please find the below code snippets and dependencies and guide us to achieve this?

Currently we have the following code snippet to establish Connection in Client:

private Future<Session> establishWebSocketConnection(String destinationURI)
throws Exception, URISyntaxException, IOException, InterruptedException {
SslContextFactory sslContextFactory = createSSLContextFactory();
if (webSocketClient == null) {
webSocketClient = new WebSocketClient(sslContextFactory);
this.socket = new CustomMessageSocket();

String agentId = "1234";
URI URI = new URI(destinationURI + "/" + agentId);
ClientUpgradeRequest request = new ClientUpgradeRequest();
Future<Session> objSession = webSocketClient.connect(socket, URI, request);
return objSession;

private SslContextFactory createSSLContextFactory() throws Exception {

SslContextFactory sslContextFactory = new SslContextFactory();
// sslContextFactory.setCertAlias("rna-cert");
// sslContextFactory.setWantClientAuth(true);
return sslContextFactory;

We are using following dependency in Websocket client to communicate with Server,

Previous Topic:test
Next Topic:I'm a newbie!
Goto Forum:

Current Time: Tue Nov 20 14:18:22 GMT 2018

Powered by FUDForum. Page generated in 0.03848 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top