From f0731eb2712019c5623db73d96a504ca49160bb6 Mon Sep 17 00:00:00 2001 From: Stephan Wald Date: Wed, 15 Aug 2018 13:18:19 +0200 Subject: [PATCH 1/2] -keyalg RSA is needed or you'll get SSLHandshakeException: no cipher suites in common --- src/main/example/SSLClientExample.java | 2 +- src/main/example/SSLServerExample.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/example/SSLClientExample.java b/src/main/example/SSLClientExample.java index 693c71bbe..fa94e210f 100644 --- a/src/main/example/SSLClientExample.java +++ b/src/main/example/SSLClientExample.java @@ -77,7 +77,7 @@ public class SSLClientExample { /* * Keystore with certificate created like so (in JKS format): * - *keytool -genkey -validity 3650 -keystore "keystore.jks" -storepass "storepassword" -keypass "keypassword" -alias "default" -dname "CN=127.0.0.1, OU=MyOrgUnit, O=MyOrg, L=MyCity, S=MyRegion, C=MyCountry" + *keytool -genkey -keyalg RSA -validity 3650 -keystore "keystore.jks" -storepass "storepassword" -keypass "keypassword" -alias "default" -dname "CN=127.0.0.1, OU=MyOrgUnit, O=MyOrg, L=MyCity, S=MyRegion, C=MyCountry" */ public static void main( String[] args ) throws Exception { WebSocketImpl.DEBUG = true; diff --git a/src/main/example/SSLServerExample.java b/src/main/example/SSLServerExample.java index 1e58d4ae4..3c275a6e8 100644 --- a/src/main/example/SSLServerExample.java +++ b/src/main/example/SSLServerExample.java @@ -41,7 +41,7 @@ public class SSLServerExample { /* * Keystore with certificate created like so (in JKS format): * - *keytool -genkey -validity 3650 -keystore "keystore.jks" -storepass "storepassword" -keypass "keypassword" -alias "default" -dname "CN=127.0.0.1, OU=MyOrgUnit, O=MyOrg, L=MyCity, S=MyRegion, C=MyCountry" + *keytool -genkey -keyalg RSA -validity 3650 -keystore "keystore.jks" -storepass "storepassword" -keypass "keypassword" -alias "default" -dname "CN=127.0.0.1, OU=MyOrgUnit, O=MyOrg, L=MyCity, S=MyRegion, C=MyCountry" */ public static void main( String[] args ) throws Exception { WebSocketImpl.DEBUG = true; @@ -50,7 +50,7 @@ public static void main( String[] args ) throws Exception { // load up the key store String STORETYPE = "JKS"; - String KEYSTORE = "keystore.jks"; + String KEYSTORE = "D:\\GitHub\\Java-WebSocket\\src\\main\\example\\keystore.jks"; String STOREPASSWORD = "storepassword"; String KEYPASSWORD = "keypassword"; From 247d2b28f19d96186c3ac49b05bd05a918459619 Mon Sep 17 00:00:00 2001 From: Stephan Wald Date: Wed, 15 Aug 2018 14:26:02 +0200 Subject: [PATCH 2/2] Update SSLServerExample.java --- src/main/example/SSLServerExample.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/example/SSLServerExample.java b/src/main/example/SSLServerExample.java index 3c275a6e8..dd130e339 100644 --- a/src/main/example/SSLServerExample.java +++ b/src/main/example/SSLServerExample.java @@ -50,7 +50,7 @@ public static void main( String[] args ) throws Exception { // load up the key store String STORETYPE = "JKS"; - String KEYSTORE = "D:\\GitHub\\Java-WebSocket\\src\\main\\example\\keystore.jks"; + String KEYSTORE = "keystore.jks"; String STOREPASSWORD = "storepassword"; String KEYPASSWORD = "keypassword";