Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to make wss connection - applet based server #316

Closed
AmsterdamRocks opened this issue Jun 4, 2015 · 2 comments
Closed

Unable to make wss connection - applet based server #316

AmsterdamRocks opened this issue Jun 4, 2015 · 2 comments

Comments

@AmsterdamRocks
Copy link

I have integrated the 1.3.1-SNAPSHOT (don't even remember when I pulled this) code into an applet as a server. I connect to this from a javascript client. It all works great when my website is not accessed through SSL. When it is SSL and I try to create the wss:https:// request then the server always fails the connection with

javax.net.ssl.SSLHandshakeException: no cipher suites in common.

This shows up at the same time though I don't know if it is referencing the request coming from my client (likely) or something within the server -

%% Initialized: [Session-1, SSL_NULL_WITH_NULL_NULL].

I have tried configuring the server as shown in the example/SSLServerExample.java and have also tried a few other options such as a custom trust manager that basically doesn't do any validation. Nothing seems to have any effect on this.

I have seen some issues opened lately so it seems there is still interest in this project but there hasn't been activity in quite a while so it seems dead. If there's anyone out there, do you have any suggestions?

The server class extends the WebSocketServer and initializes as shown below. When getting the SSLContext I've tried both "SSL" and "TLS".

System.setProperty("javax.net.debug", "ssl");
super(1111, new Draft_17());
URL keyfile = new URL(path to my keystore);
KeyStore key_store = KeyStore.getInstance("JKS");
key_store.load(keyfile.openStream(), "xxxx".toCharArray());
KeyManagerFactory kmf = KeyManagerFactory.getInstance( "SunX509" );
kmf.init( key_store, "xxxxx".toCharArray() );
SSLContext sslContext = SSLContext.getInstance("SSL");
sslContext.init(kmf.getKeyManagers(), createTrustManager(), new SecureRandom());
this.setWebSocketFactory(new DefaultSSLWebSocketServerFactory(sslContext));
this.start();

This is the custom trust manager:

private TrustManager[] createTrustManager() {
TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
@OverRide
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType)
throws java.security.cert.CertificateException
{
System.out.println("Got the client certificates: " + Arrays.asList(chain));
}
@OverRide
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws java.security.cert.CertificateException
{
System.out.println("Got the server certificates: " + Arrays.asList(chain));
}
@OverRide
public java.security.cert.X509Certificate[] getAcceptedIssuers()
{
return null;
}
}
};
return trustAllCerts;
}

@marci4
Copy link
Collaborator

marci4 commented Apr 26, 2017

Hello @AmsterdamRocks
sorry for the huge delay.
Trying to get through all the old issues....

I right now cannot reproduce this issue.
Could you please update to 1.3.3?

Greetings
marci4

@marci4
Copy link
Collaborator

marci4 commented Oct 12, 2017

No steps to reproduce. No response.

Closing a dead issue

@marci4 marci4 closed this as completed Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants