javax.net.ssl.SSLHandshakeException: No appropriate protocol
大家好,我是 程序员码递夫。
我有个SpringBoot项目用到邮件发送功能, 在开发环境运行,一切正常,但是我 部署jar 包,在本机上运行时却报错了, 提示:
javax.mail.MessagingException: Could not convert socket to TLS;
nested exception is:
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
问题有点跟另一篇文章遇到的一样。
com.microsoft.sqlserver.jdbc.SQLServerException: 驱动程序无法使用安全套接字层(SSL)加密与 SQL Server 建立安全连接
后来发现是我的 jdk 没用对, 我开发环境用的是jdk1.8, 而操作系统 默认是 jdk17。 进入操作系统的环境变量设置,把jdk1.8 的路径移到 jdk17 的前面, 这样Java 命令行就优先使用 jdk1.8了。 问题解决。
如果问题,没解决请看另一篇:com.microsoft.sqlserver.jdbc.SQLServerException: 驱动程序无法使用安全套接字层(SSL)加密与 SQL Server 建立安全连接