Java Exception on SSLSocket creation

前端 未结 4 1277
执笔经年
执笔经年 2021-01-16 22:05

In the code:

System.setProperty(\"javax.net.ssl.trustStore\", cacerts);
System.setProperty(\"javax.net.ssl.trustStorePassword\", pwdCacerts);

SSLSocketFact         


        
4条回答
  •  南笙
    南笙 (楼主)
    2021-01-16 22:41

    Thanks for your Answer... Solved my problem by putting this code :

    System.setProperty("javax.net.ssl.trustStoreType","JCEKS");
    

    Code as follows :

    System.setProperty("javax.net.ssl.keyStore", CommonUtils.getKeystorePath());
    System.setProperty("javax.net.ssl.keyStorePassword", 
                       CommonUtils.getKeystorePassword());
    System.setProperty("javax.net.ssl.trustStore", 
                       CommonUtils.getTruststorePath());
    System.setProperty("javax.net.ssl.trustStorePassword", 
                       CommonUtils.getTruststorePassword());
    System.setProperty("javax.net.ssl.trustStoreType","JCEKS");
    

提交回复
热议问题