Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » jetty websocket certificate validation
jetty websocket certificate validation [message #1781270] Mon, 05 February 2018 11:20 Go to next message
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,
Re: jetty websocket certificate validation [message #1781283 is a reply to message #1781270] Mon, 05 February 2018 13:40 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 29598
Registered: July 2009
Senior Member
This isn't a JDT question. Try the user mailing list referenced by
Previous Topic:Project cannot find resources in another project at runtime
Next Topic:swt hello world tutorial
Goto Forum:

Current Time: Sun Oct 21 18:23:53 GMT 2018

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

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

Back to the top