SSL connection failure between java server and android client

前端 未结 2 1780
北恋
北恋 2021-01-17 01:42

I am trying to setup mutual authentication SSL connection between java host and android client. Don\'t know why its not getting connected. Below are the code of Android clie

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-17 01:58

    It's solved ! Problem was with the truststore of java host, followed this post.

    The trustStore needs to be specified for client/server as they are using the default trustStore, causing failure. Using -Djavax.net.ssl.trustStore=servertruststore.jks -Djavax.net.ssl.trustStorePassword=server on the server and creating own keystore & truststore at client allows the session to complete. It was the -Djavax.net.debug=ssl,handshake which helped lot.

    The entire command is : java -Djavax.net.ssl.keyStore=server.jks -Djavax.net.ssl.keyStorePassword=server -Djavax.net.ssl.trustStore=servertruststore.jks -Djavax.net.ssl.trustStorePassword=server SSLServer

    Now i am on to creating sslsession and multi-threaded programming.

提交回复
热议问题