how to ignore server cert error in javamail

后端 未结 10 1342
长发绾君心
长发绾君心 2020-12-05 07:12

when i connect to my imap server using imaps,it failes.

can you tell me how to ignore server cert error in javamail

Exception in thread \"main\"
java         


        
10条回答
  •  孤街浪徒
    2020-12-05 07:51

    Don't ignore certificate verification errors (unless perhaps in a test environment): this defeats the point of using SSL/TLS.

    Instead, if you know you trust that server certificate, import it in your trust store (either the global trust store of the JRE or a local one that you specify with the javax.net.ssl.trustStore* system properties, for example).

提交回复
热议问题