Skip to content

Commit f0731eb

Browse files
author
Stephan Wald
committed
-keyalg RSA is needed or you'll get SSLHandshakeException: no cipher suites in common
1 parent 8e9c82a commit f0731eb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/example/SSLClientExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public class SSLClientExample {
7777
/*
7878
* Keystore with certificate created like so (in JKS format):
7979
*
80-
*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"
80+
*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"
8181
*/
8282
public static void main( String[] args ) throws Exception {
8383
WebSocketImpl.DEBUG = true;

src/main/example/SSLServerExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class SSLServerExample {
4141
/*
4242
* Keystore with certificate created like so (in JKS format):
4343
*
44-
*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"
44+
*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"
4545
*/
4646
public static void main( String[] args ) throws Exception {
4747
WebSocketImpl.DEBUG = true;
@@ -50,7 +50,7 @@ public static void main( String[] args ) throws Exception {
5050

5151
// load up the key store
5252
String STORETYPE = "JKS";
53-
String KEYSTORE = "keystore.jks";
53+
String KEYSTORE = "D:\\GitHub\\Java-WebSocket\\src\\main\\example\\keystore.jks";
5454
String STOREPASSWORD = "storepassword";
5555
String KEYPASSWORD = "keypassword";
5656

0 commit comments

Comments
 (0)