-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Labels
Comments
Hello @AmsterdamRocks I right now cannot reproduce this issue. Greetings |
No steps to reproduce. No response. Closing a dead issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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;
}
The text was updated successfully, but these errors were encountered: