我试图建立相互SSL 2之间的Websphere 8.5.5服务器。 我就打电话给他们ServerA和ServerB上。
服务器A:客户端,加入ServerB的SSL证书到DefaultTrustKeyStore。
服务器B:服务器端,服务器A中添加的SSL证书到DefaultTrustKeyStore。 我还安装了一场战争,提供可以接收HTTP POST消息,记录它,并响应“OK”,以客户端的servlet。 客户端验证模式设置为“必需”。
现在我有一个问题:相互SSL客户端的传统方式必须直接读取密钥库检索私钥,所以我们可以用它来建立我们的SSLContext做客户端验证。 但它也可能有直接访问密钥库的安全漏洞。 所以,我需要找到,如果我可以让我的服务器A的WebSphere为我(或者可以指挥的Websphere做到这一点的Java代码)做到这一点的方式。
谁能教我如何做到这一点不必直接访问密钥库,好吗?
更新:
嗨dbreaux。
我想用自己的方式做了环回连接,但它似乎不工作。
这里的SSL调试日志最后一段:
[2017/9/3 21:06:25:284 CST] 00000099 SystemOut O JsseJCE: Using KeyGenerator IbmTlsPrf from provider TBD via init
[2017/9/3 21:06:25:284 CST] 00000099 SystemOut O HandshakeMessage: TLS Keygenerator IbmTlsPrf from provider from init IBMJCE version 1.8
[2017/9/3 21:06:25:284 CST] 00000099 SystemOut O WebContainer : 3, WRITE: TLSv1 Change Cipher Spec, length = 1
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O JsseJCE: Using cipher AES/CBC/NoPadding from provider TBD via init
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O CipherBox: Using cipher AES/CBC/NoPadding from provider from init IBMJCE version 1.8
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O JsseJCE: Using MAC HmacSHA1 from provider TBD via init
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O MAC: Using MessageDigest HmacSHA1 from provider IBMJCE version 1.8
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O *** Finished
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O verify_data: { 226, 248, 159, 68, 107, 196, 76, 219, 134, 227, 129, 58 }
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O ***
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O WebContainer : 3, WRITE: TLSv1 Handshake, length = 48
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O WebContainer : 3, waiting for close_notify or alert: state 1
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O WebContainer : 3, Exception while waiting for close java.net.SocketException: Software caused connection abort: recv failed
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O %% Invalidated: [Session-27, SSL_ECDHE_RSA_WITH_AES_128_CBC_SHA]
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O WebContainer : 3, SEND TLSv1 ALERT: fatal, description = handshake_failure
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O WebContainer : 3, WRITE: TLSv1 Alert, length = 32
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O WebContainer : 3, Exception sending alert: java.net.SocketException: Software caused connection abort: socket write error
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O WebContainer : 3, called closeSocket()
[2017/9/3 21:06:25:285 CST] 00000099 SystemOut O WebContainer : 3, handling exception: javax.net.ssl.SSLHandshakeException: java.net.SocketException: Software caused connection abort: recv failed
我使用的是已生成的DefaultKeyStores。 由于动态出站端点页继续给我CWPKI0681E
错误,所以我申请的第一种方式。
请问你对这项工作? 或者是因为我使用生成的默认CA?
11/06更新:
我发现了一些线索可能有助于解决这个问题。 我试图使用OpenSSL的建立客户端连接到服务器,并有一些有趣的东西。
首先,我用我的客户端是连接到服务器端的是,我结束了与此异常和服务器刚把我的连接。 下面是服务器端日志:
[2017/11/3 18:07:19:349 CST] 00000070 SystemOut O WebContainer : 0, WRITE: TLSv1 Handshake, length = 2765
[2017/11/3 18:07:19:355 CST] 00000070 SystemOut O WebContainer : 0, READ: TLSv1 Handshake, length = 77
[2017/11/3 18:07:19:355 CST] 00000070 SystemOut O *** Certificate chain
[2017/11/3 18:07:19:355 CST] 00000070 SystemOut O ***
[2017/11/3 18:07:19:357 CST] 00000070 SystemOut O WebContainer : 0, fatal error: 40: null cert chain
javax.net.ssl.SSLHandshakeException: null cert chain
[2017/11/3 18:07:19:357 CST] 00000070 SystemOut O %% Invalidated: [Session-1, SSL_ECDHE_RSA_WITH_AES_128_CBC_SHA]
[2017/11/3 18:07:19:357 CST] 00000070 SystemOut O WebContainer : 0, SEND TLSv1 ALERT: fatal, description = handshake_failure
[2017/11/3 18:07:19:358 CST] 00000070 SystemOut O WebContainer : 0, WRITE: TLSv1 Alert, length = 2
[2017/11/3 18:07:19:358 CST] 00000070 SystemOut O WebContainer : 0, fatal: engine already closed. Rethrowing javax.net.ssl.SSLHandshakeException: null cert chain
现在,我尝试服务器使用OpenSSL与下面的命令连接, ClientCA.key
是我的私有密钥:
openssl s_client -tls1 -connect 192.168.1.20:9443 -key ClientCA.key -state
CONNECTED(00000168)
SSL_connect:before SSL initialization
SSL_connect:SSLv3/TLS write client hello
SSL_connect:SSLv3/TLS write client hello
SSL_connect:SSLv3/TLS read server hello
depth=1 C = US, O = IBM, OU = TestNode01, OU = TestNode01Cell, OU = Root Certificate, CN = Test
verify error:num=19:self signed certificate in certificate chain
SSL_connect:SSLv3/TLS read server certificate
SSL_connect:SSLv3/TLS read server key exchange
SSL_connect:SSLv3/TLS read server certificate request
SSL_connect:SSLv3/TLS read server done
SSL_connect:SSLv3/TLS write client certificate
SSL_connect:SSLv3/TLS write client key exchange
SSL_connect:SSLv3/TLS write change cipher spec
SSL_connect:SSLv3/TLS write finished
SSL_connect:error in SSLv3/TLS write finished
write:errno=0
...
我得到了下降,看同样的异常,在日志的末尾了。 但是,如果我给我的证书命令:
openssl s_client -tls1 -connect 192.168.1.20:9443 -cert ClientCA.crt -key ClientCA.pfx -state
CONNECTED(00000150)
SSL_connect:before SSL initialization
SSL_connect:SSLv3/TLS write client hello
SSL_connect:SSLv3/TLS write client hello
SSL_connect:SSLv3/TLS read server hello
depth=1 C = US, O = IBM, OU = SAGE-AD2Node01, OU = SAGE-AD2Node01Cell, OU = Root Certificate, CN = SAGE-AD2
verify error:num=19:self signed certificate in certificate chain
SSL_connect:SSLv3/TLS read server certificate
SSL_connect:SSLv3/TLS read server key exchange
SSL_connect:SSLv3/TLS read server certificate request
SSL_connect:SSLv3/TLS read server done
SSL_connect:SSLv3/TLS write client certificate
SSL_connect:SSLv3/TLS write client key exchange
SSL_connect:SSLv3/TLS write certificate verify
SSL_connect:SSLv3/TLS write change cipher spec
SSL_connect:SSLv3/TLS write finished
SSL_connect:SSLv3/TLS write finished
SSL_connect:SSLv3/TLS read change cipher spec
SSL_connect:SSLv3/TLS read finished
...
我连接到服务器! 和服务器日志看起来也不同:
[2017/11/6 16:19:55:246 CST] 00000073 SystemOut O WebContainer : 0, WRITE: TLSv1 Handshake, length = 2765
[2017/11/6 16:19:55:309 CST] 00000073 SystemOut O WebContainer : 0, READ: TLSv1 Handshake, length = 853
[2017/11/6 16:19:55:309 CST] 00000073 SystemOut O *** Certificate chain
[2017/11/6 16:19:55:309 CST] 00000073 SystemOut O chain [0] = [
[
Version: V1
...
所以我怀疑我必须错过了我的客户端的一些安装程序,所以也没把我的证书服务器这是我的内P12
文件。 你能描述一下你是如何实现它的详细信息? @Alaine @dbreaux