java 连接 sqlserver 报错

发布时间 2023-05-17 09:27:00作者: 逍遥子_何

使用最新的 sqlserver 驱动报错:

com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: "encrypt" property is set to "true" and "trustServerCertificate" property is set to "false" but the driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption: Error: The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]. ClientConnectionId:52d71b80-acde-485d-927c-f75f4b96cc4c

网上说的改jdk

C:\Program Files\Java\jdk1.8.0_301\jre\lib\security路径下的

文件中找到将TLSv1, TLSv1.1,3DES_EDE_CBC注释掉就行了

不能解决;

 

直接在连接字符上 配置 

encrypt=false; 就行了。
我这边数据库比较老是sqlserver 2012