简体   繁体   English

在 Websphere Liberty 中设置 2 路 ssl 身份验证并验证它

[英]Setup 2 way ssl authentication in Websphere Liberty and verify it

I am using https://github.com/TooTallNate/Java-WebSocket for my socket communication in my web server application.我在 Web 服务器应用程序中使用https://github.com/TooTallNate/Java-WebSocket进行套接字通信。

I want to set up mutual authentication in my service.我想在我的服务中设置相互身份验证。 I have set the keystore and truststore in my server and client application.我已经在我的服务器和客户端应用程序中设置了密钥库和信任库。 What I am not able to figure out is, do I need to change code to perform 2 way authentication?我无法弄清楚的是,我是否需要更改代码来执行 2 路身份验证? Right now I am able to confirm that the communication is happening over a secure channel.现在我能够确认通信是通过安全通道进行的。 Is there anyway to verify that 2 way SSL authentication (mutual authentication) is happening?无论如何要验证2 way SSL authentication (mutual authentication)是否正在发生? I am running my service on Websphere Liberty我在 Websphere Liberty 上运行我的服务

Source for ssl communication in Java websockets: https://github.com/TooTallNate/Java-WebSocket/blob/Java-WebSocket-1.3.0/src/main/java/org/java_websocket/SSLSocketChannel2.java Java websockets中ssl通信的来源: https : //github.com/TooTallNate/Java-WebSocket/blob/Java-WebSocket-1.3.0/src/main/java/org/java_websocket/SSLSocketChannel2.java

I see that in Liberty I can request for a client side certificate https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_sec_clientcert.html However why is it that I need to add the certificate in my browser?我看到在 Liberty 我可以请求客户端证书https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_sec_clientcert.html但是为什么我需要在浏览器中添加证书吗? Shouldn't I be adding the client side certificate in my server's trust-store?我不应该在服务器的信任库中添加客户端证书吗?

To enable client authentication or mutual authentication, you will need to enable clientAuthentication="true" as given in sample below on Liberty.要启用客户端身份验证或相互身份验证,您需要启用clientAuthentication="true",如下面的 Liberty 示例所示。

           <ssl id="myDefaultSSLConfig"
           keyStoreRef="defaultKeyStore"
           trustStoreRef="defaultTrustStore"
           clientAuthentication="true"
           sslProtocol="TLS" />

As mentioned on the above link, browser needs to either add or accept the server certificate and also the server needs to have signer certificate of the client.如上述链接所述,浏览器需要添加或接受服务器证书,并且服务器还需要具有客户端的签名者证书。 Both client and server needs to have trust established for mutual communication to work.客户端和服务器都需要建立信任才能进行相互通信。

From above link: https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_sec_clientcert.html从上面的链接: https : //www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_sec_clientcert.html

  1. Add a client certificate to your browser.将客户端证书添加到您的浏览器。 See the documentation of your browser for adding client certificates.请参阅浏览器的文档以添加客户端证书。
  2. Make sure the server trusts any client certificates that are used.确保服务器信任使用的所有客户端证书。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM