mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8020207: jconsole fails connecting over SSL using service:jmx:rmi://...jndi...
Reviewed-by: kevinw
This commit is contained in:
parent
a0c4124432
commit
ea7186a87f
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -34,6 +34,7 @@ import java.lang.management.*;
|
|||||||
import static java.lang.management.ManagementFactory.*;
|
import static java.lang.management.ManagementFactory.*;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.lang.reflect.*;
|
import java.lang.reflect.*;
|
||||||
|
import java.net.URI;
|
||||||
import java.rmi.*;
|
import java.rmi.*;
|
||||||
import java.rmi.registry.*;
|
import java.rmi.registry.*;
|
||||||
import java.rmi.server.*;
|
import java.rmi.server.*;
|
||||||
@ -133,7 +134,24 @@ public class ProxyClient implements JConsoleContext {
|
|||||||
this.advancedUrl = url;
|
this.advancedUrl = url;
|
||||||
this.connectionName = getConnectionName(url, userName);
|
this.connectionName = getConnectionName(url, userName);
|
||||||
this.displayName = connectionName;
|
this.displayName = connectionName;
|
||||||
setParameters(new JMXServiceURL(url), userName, password);
|
JMXServiceURL jmxServiceURL = new JMXServiceURL(url);
|
||||||
|
setParameters(jmxServiceURL, userName, password);
|
||||||
|
if ("rmi".equals(jmxServiceURL.getProtocol())) {
|
||||||
|
String path = jmxServiceURL.getURLPath();
|
||||||
|
if (path.startsWith("/jndi/")) {
|
||||||
|
int end = path.indexOf(';');
|
||||||
|
if (end < 0) end = path.length();
|
||||||
|
String registryURIStr = path.substring(6, end);
|
||||||
|
URI registryURI = URI.create(registryURIStr);
|
||||||
|
if ("rmi".equals(registryURI.getScheme())
|
||||||
|
&& "/jmxrmi".equals(registryURI.getPath())) {
|
||||||
|
this.registryHostName = registryURI.getHost();
|
||||||
|
this.registryPort = registryURI.getPort();
|
||||||
|
this.vmConnector = true;
|
||||||
|
checkSslConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ProxyClient(LocalVirtualMachine lvm) throws IOException {
|
private ProxyClient(LocalVirtualMachine lvm) throws IOException {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user