报错信息:

Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: 驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“The server selected protocol version TLS10 is not accepted by client preferences [TLS12]”。 ClientConnectionId:d6d6aa5b-b411-46e0-bfbc-d82a268c3ddf
    at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81)
    at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82)
    at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68)
    at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:338)
    at org.apache.ibatis.executor.ReuseExecutor.prepareStatement(ReuseExecutor.java:88)

解决方法:
升级到jdk1.8.291后产生的
需要在jre的jre\lib\security文件夹下编辑 java.security 文件
注释掉TLSv1, TLSv1.1即可

#jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
jdk.tls.disabledAlgorithms=SSLv3,RC4, DES, MD5withRSA,

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code