Java7 Refusing to trust certificate in trust store

后端 未结 3 1082
梦毁少年i
梦毁少年i 2020-12-01 14:59

I\'ve a weird problem - a supplier uses TLS SSLv3 with both a self signed client and server certificate. This hasn\'t been a problem with Java1.5 and Java1.6 - simply import

3条回答
  •  感情败类
    2020-12-01 15:44

    For some reasons Java 8 doesn't accept self-signed certificate even added to its cacerts store.

    My workaround for that is to create a custom keystore :

    openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -subj "/C=MA/ST=ByExample/L=Test/O=Chapter3/OU=Org/CN=bip70.com" -nodes

    keytool -import -keystore clientkeystore -file cert.der -alias bip70.com -storepass changeit
    

    then using it in My IDE using as jvm argument: -Djavax.net.ssl.trustStore=clientkeystore

提交回复
热议问题