Skip to content
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

SSL on jmxxtrans is not working #814

Open
ssonaa opened this issue Jan 17, 2024 · 0 comments
Open

SSL on jmxxtrans is not working #814

ssonaa opened this issue Jan 17, 2024 · 0 comments

Comments

@ssonaa
Copy link

ssonaa commented Jan 17, 2024

I have enabled SSL via export export SSL_TRUSTSTORE="${JMX_SSL_TRUSTSTORE}" command and I am getting the below error. All the configs are set correctly, the monitored application has the required flags as below:

if [ "$SERVICE" = "metastore" ]; then export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=true -Djava.rmi.server.hostname=$HOSTNAME -Dcom.sun.management.jmxremote.ssl.config.file=/home/hive_ssl.properties -Dcom.sun.management.jmxremote.registry.ssl=true -Dcom.sun.management.jmxremote.port=8009 -Dcom.sun.management.jmxremote.access.file=/home/jmxremote.access -Dcom.sun.management.jmxremote.password.file=/home/jmxremote.password" fi

and json config file also has "ssl": true

In the jmxtrans.sh script I have the env variables as below:

if [ "${PULSEJMX_SSL_TRUSTSTORE}" != "" ]; then
    export SSL_TRUSTSTORE="${PULSEJMX_SSL_TRUSTSTORE}"
    echo "SSL TrustStore is enabled: ${SSL_TRUSTSTORE}"
fi

# Setting SSL_TRUSTSTORE_PASSWORD env var for pulsejmx
if [ "${PULSEJMX_SSL_TRUSTSTORE_PASSWORD}" != "" ]; then
    export SSL_TRUSTSTORE_PASSWORD="${PULSEJMX_SSL_TRUSTSTORE_PASSWORD}"
    echo "SSL TrustStore Password is enabled"
fi

Why am I getting the below error? Is jmxtrans not able to pick the path from the environment variable?

java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target] at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369) at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270) at com.googlecode.jmxtrans.model.Server.getServerConnection(Server.java:339) at com.googlecode.jmxtrans.connections.MBeanServerConnectionFactory.makeObject(MBeanServerConnectionFactory.java:46) at com.googlecode.jmxtrans.connections.MBeanServerConnectionFactory.makeObject(MBeanServerConnectionFactory.java:33) at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220) at com.googlecode.jmxtrans.model.Server.execute(Server.java:271) at com.googlecode.jmxtrans.jmx.ProcessQueryThread.run(ProcessQueryThread.java:55) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750) Caused by: javax.naming.CommunicationException: null at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:136) at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:218) at javax.naming.InitialContext.lookup(InitialContext.java:417) at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1955) at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1922) at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:287) ... 12 common frames omitted Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:307) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202) at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:343) at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:116) at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:132) ... 17 common frames omitted Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant