我正嘗試使用jconsole遠程連接到應用程序。沒有SSL,我的配置沒有問題。與ssl一起使用jconsole時的握手失敗
我已經在服務器上創建一個公共密鑰我想訪問:
sudo keytool -keystore broker.ks -alias broker -genkey -keyalg RSA
我已經然後導出的證書:
sudo keytool -export -alias broker -keystore broker.ks -file broker_cert.crt
客戶端創建一個信任存儲並導入證書:
-import -alias broker -keystore broker.ts -file broker_cert.crt
然後我啓動我的經紀人服務器端如下:
java \
-Xms1024M \
-Xmx1024M \
-Dcom.sun.management.jmxremote.port=1099 \
-Dcom.sun.management.jmxremote.password.file=/etc/activemq/jmx.password \
-Dcom.sun.management.jmxremote.access.file=/etc/activemq/jmx.access \
-Dcom.sun.management.jmxremote \
-jar broker.jar \
-Djavax.net.ssl.keyStore=/etc/activemq/broker.ks \
-Djavax.net.ssl.keyStorePassword=password
正如我所提到的,密碼配置能夠正常工作,因爲我可以在將jmxremote.ssl設置爲false時進行連接。
客戶端我然後啓動JConsole的,像這樣:
jconsole -J-Djavax.net.ssl.trustStore=/etc/activemq/broker.ts -J-Djavax.net.ssl.trustStorePassword=password -J-Djava.util.logging.config.file=/etc/activemq/logging.properties
當試圖連接到服務器的日誌給我下面的錯誤:
failed to connect: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
爲了詳細說明這一點,我的證書正確設置。
keytool -list -keystore broker.ks
並且接受:服務器端,我可以在/ etc/ActiveMQ的做在/ etc/ActiveMQ的
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
broker, 01-May-2012, PrivateKeyEntry,
Certificate fingerprint (MD5): 30:55:60:4A:B5:85:D0:C5:2C:E9:DD:AD:1E:92:BE:6E
客戶端,我可以鍵入:
keytool -list -keystore broker.ks
並且接受:
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
broker, May 3, 2012, trustedCertEntry,
Certificate fingerprint (MD5): 30:55:60:4A:B5:85:D0:C5:2C:E9:DD:AD:1E:92:BE:6E
正如你所看到的證書fi指紋匹配。更令人沮喪的是,當我啓動jconsole時,我可以在-J-Djavax.net.ssl.trustStore=<boguspathhere>
中完全僞造一條路徑,但我收到的錯誤與我在正確的錯誤/etc/activemq/broker.ts
時完全相同 - 我期望日誌至少能告訴我是否它已經找到了信任商店或沒有!而不是隻給
failed to connect: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
GRRRR
很明顯,表示證書未正確導入。確保證書正在顯示和JAVA_HOME設置。 – kosa
爲什麼選擇Java_Home?我在這種情況下使用明確的路徑? – mogronalol