服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

使用SSL和自签名证书使JMX在Tomcat 7下工作

我正在尝试使用SSL在Tomcat 7.0.23下运行JMX。 服务器位于AWS,这意味着所有主机都是NAT,我需要使用JmxRemoteLifecycleListener来显式设置JMX使用的两个端口。 我已经在这个主题上做了大量的阅读,但是我不能让所有的部分一起正常工作。 我可以让JMX在没有SSL的情况下正常工作。 我已经为我的Tomcat版本下载了catalina-jmx-remote.jar的版本,并将其安装在我的tomcat / lib目录中。 我的server.xml包含: <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="1099" rmiServerPortPlatform="1098" /> 当我用以下设置启动Tomcat时,我可以连接一个不安全的会话: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.password.file=/path/to/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/path/to/jmxremote.access -Djava.rmi.server.hostname=<public IP of server> -Dcom.sun.management.jmxremote.ssl=false 但是,如果我改变这些以下,那么我无法build立一个SSL连接: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.password.file=/path/to/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/path/to/jmxremote.access -Djava.rmi.server.hostname=<public IP of server> -Dcom.sun.management.jmxremote.ssl=true -Dcom.sun.management.jmxremote.registry.ssl=true -Dcom.sun.management.jmxremote.ssl.need.client.auth=false -Dcom.sun.management.jmxremote.authenticate=true -Djavax.net.ssl.keyStore=/path/to/keystore.dat -Djavax.net.ssl.keyStorePassword=<password> -Djavax.net.ssl.trustStore=/path/to/truststore.dat -Djavax.net.ssl.trustStorePassword=<password> keystore.dat仅包含通过以下方式创build的单个证书: openssl x509 -outform der -in cert.pem -out cert.der keytool -import -alias tomcat -keystore keystore.dat -file […]