Navigation Menu

Skip to content

Commit

Permalink
8293657: sun/management/jmxremote/bootstrap/RmiBootstrapTest.java#id1…
Browse files Browse the repository at this point in the history
… failed with "SSLHandshakeException: Remote host terminated the handshake"

Reviewed-by: mbaesken
Backport-of: f6d78cda853ce6ec6fdda845f1799253461fc618
  • Loading branch information
RealLucy committed Jul 5, 2023
1 parent a975a1e commit b3417d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -902,9 +902,6 @@ public ServerSocket createServerSocket(int port) throws IOException {
private static class HostAwareSslSocketFactory extends SslRMIServerSocketFactory {

private final String bindAddress;
private final String[] enabledCipherSuites;
private final String[] enabledProtocols;
private final boolean needClientAuth;
private final SSLContext context;

private HostAwareSslSocketFactory(String[] enabledCipherSuites,
Expand All @@ -919,11 +916,9 @@ private HostAwareSslSocketFactory(SSLContext ctx,
String[] enabledProtocols,
boolean sslNeedClientAuth,
String bindAddress) throws IllegalArgumentException {
this.context = ctx;
super(ctx, enabledCipherSuites, enabledProtocols, sslNeedClientAuth);
this.bindAddress = bindAddress;
this.enabledProtocols = enabledProtocols;
this.enabledCipherSuites = enabledCipherSuites;
this.needClientAuth = sslNeedClientAuth;
this.context = ctx;
checkValues(ctx, enabledCipherSuites, enabledProtocols);
}

Expand All @@ -933,14 +928,15 @@ public ServerSocket createServerSocket(int port) throws IOException {
try {
InetAddress addr = InetAddress.getByName(bindAddress);
return new SslServerSocket(port, 0, addr, context,
enabledCipherSuites, enabledProtocols, needClientAuth);
this.getEnabledCipherSuites(), this.getEnabledProtocols(),
this.getNeedClientAuth());
} catch (UnknownHostException e) {
return new SslServerSocket(port, context,
enabledCipherSuites, enabledProtocols, needClientAuth);
this.getEnabledCipherSuites(), this.getEnabledProtocols(), this.getNeedClientAuth());
}
} else {
return new SslServerSocket(port, context,
enabledCipherSuites, enabledProtocols, needClientAuth);
this.getEnabledCipherSuites(), this.getEnabledProtocols(), this.getNeedClientAuth());
}
}

Expand Down
@@ -1,5 +1,5 @@
com.sun.management.jmxremote.ssl.enabled.cipher.suites=TLS_DHE_DSS_WITH_AES_128_GCM_SHA256
com.sun.management.jmxremote.ssl.enabled.cipher.suites=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA
com.sun.management.jmxremote.ssl.enabled.protocols=SSLv2Hello,SSLv3,TLSv1
com.sun.management.jmxremote.ssl.need.client.auth=true
com.sun.management.jmxremote.authenticate=false
javax.rmi.ssl.client.enabledCipherSuites=TLS_DHE_DSS_WITH_AES_128_GCM_SHA256
javax.rmi.ssl.client.enabledCipherSuites=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA

1 comment on commit b3417d8

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.