Jazz510 发表于 2026-3-10 23:21:16

升级后,还是数据库连接问题,连接报错

本帖最后由 Jazz510 于 2026-3-15 11:49 编辑

环境:
Windows Server 2012R2
Sql Server 2008R2
采用了https协议
从9.1.3升级到9.5.2

【升级之前,正常工作】
externalDataSources.json文件内容:
"url" : "jdbc:sqlserver://127.0.0.1:1433;DatabaseName=FXOA;selectMethod=cursor;sendStringParametersAsUnicode=false;",

java目录下的java.security文件内容:
jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, \
    DH keySize < 1024, EC keySize < 224,anon, NULL, \
    include jdk.disabled.namedCurves

【升级之后】
externalDataSources.json修改了几种方案:
1、只添加trustServerCertificate=true(参照https://forum.o2oa.net/forum.php?mod=viewthread&tid=266195&highlight=sqlServer)
2、添加encrypt=true;trustServerCertificate=true(参照https://blog.csdn.net/ZL_1618/article/details/137709919):
"url" : "jdbc:sqlserver://127.0.0.1:1433;DatabaseName=FXOA;selectMethod=cursor;sendStringParametersAsUnicode=false;encrypt=true;trustServerCertificate=true"

java.security文件内容修改方案:
1、删除disabledAlgorithms=,删掉前三个(SSLv3, TLSv1, TLSv1.1, ),参照https://blog.csdn.net/suya2011/article/details/125355622
2、只删除TLSv1, TLSv1.1和3DES_EDE_CBC,
【报错信息】
2026-03-10 22:41:57.725 INFO System.err - 3月 10, 2026 10:41:57 下午 com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
警告: TLSv1 was negotiated. Please update server and client to use TLSv1.2 at minimum.
2026-03-10 22:41:57.760 ERROR com.alibaba.druid.pool.DruidDataSource - init datasource error, url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=FXOA;selectMethod=cursor;sendStringParametersAsUnicode=false;Encrypt=true;trustServerCertificate=true;
com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset


最后实在没办法,就只在externalDataSources.json文件里采用了encrypt=false;就可以打开平台了,但这不是办法,请各位管理和大师提供解决方案


页: [1]
查看完整版本: 升级后,还是数据库连接问题,连接报错