SSL connection failure between java server and android client

前端 未结 2 1782
北恋
北恋 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:54

    From the stack trace it looks like exception you caught does not contain a message.

    Log.d(TAG, e.getMessage());
    

    It has nothing to do with SSL.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题