使用java连接https的问题

在使用hudson的过程中,我们需要发送邮件的功能。但是公司的邮箱是需要ssl加密的,这样仅仅配置邮件地址,点击发送测试邮件的时候,就会报java exception:

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

 

问题解决其实很简单,就是要把ssl的证书加入到java的keystore当中。可以参照如下的文章通过openssl的命令获取ssl证书:

 

http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services

你可能感兴趣的:(https)