自己搭建的邮件服务器 + 自签的SSL证书,通过代码调用时是不受jdk是信任的。
CA比较新或自行颁发的证书,需要将证书加入到jdk的信任证书库中,
把该证书导入java中的cacerts证书库里
Jdk的安装目录 C:\Program Files\Java\jdk1.8.0\jre\lib\security
执行系统命令:
1、进入安装目录
cd C:\Program Files\Java\jdk1.8.0\jre\lib\security
2、自签证书添加到jdk的信任证书库中