SSL Exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown

后端 未结 1 714
猫巷女王i
猫巷女王i 2021-01-12 07:39

I have created a SSLClient and SSLServer and also created the keystore as \"server.jks\" for SSLServer and \"client.jks\" for SSLClient. fi

相关标签:
1条回答
  • 2021-01-12 08:04

    finally i able to solve my exception itself. Actually i was doing a silly mistakes out there that was :- In both server and client file i was using the same property as

    Before it was :-

    For SSLServer :-
        System.setProperty("javax.net.ssl.keyStore","server.jks");
        System.setProperty("javax.net.ssl.keyStorePassword", "123456");
    For SSLClient :-
            System.setProperty("javax.net.ssl.keyStore","client.jks");
            System.setProperty("javax.net.ssl.keyStorePassword", "123456");
    

    Now it is :-

    For SSLServer :-
            System.setProperty("javax.net.ssl.keyStore","server.jks");
            System.setProperty("javax.net.ssl.keyStorePassword", "123456");
    For SSLClient :-
            System.setProperty("javax.net.ssl.trustStore","client.jks");
            System.setProperty("javax.net.ssl.trustStorePassword", "123456");
    

    I had to use javax.net.ssl.trustStore instead of i was using javax.net.ssl.keyStore in client and javax.net.ssl.trustStorePassword instead of i was using javax.net.ssl.keyStorePassword in client also. So after correcting it my exception has been removed and it started working. thanks

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