简体   繁体   English

如何使用 java 连接到具有 TLS 版本 1.2 的 DB2 数据库?

[英]How to connect using java to DB2 database with TLS version 1.2?

I see we have different parameters for connecting to the DB2 database like,我看到我们有不同的参数用于连接到 DB2 数据库,例如,

sslConnection=true
sslTrustStoreLocation=/opt/db211.5/sslkey_b2biqarhlmk9/key.jks
sslTrustStorePassword=password

This parameter can be passed to the JDBC url for DB2, and this establishes the SSL connection between application and DB2 database. This parameter can be passed to the JDBC url for DB2, and this establishes the SSL connection between application and DB2 database. However, is there a way by which we can restrict the TLS version for the connection?但是,有没有一种方法可以限制连接的 TLS 版本? How to specify the exact TLS version, say TLSv1.2 for this connection?如何指定确切的 TLS 版本,例如此连接的 TLSv1.2?

Thanks Dev感谢开发

Add the sslVersion=TLSv1.2;添加sslVersion=TLSv1.2; property to your URL.您的 URL 的财产。
This prevents connections to non-TLSv12 enabled Db2 LUW databases or enforce TLSv1.2 mode if, say, your server supports both modes with SSL_VERSIONS dbm cfg set to TLSV12,TLSV1 .这可以防止连接到未启用 TLSv12 的 Db2 LUW 数据库,或者如果您的服务器支持SSL_VERSIONS dbm cfg 设置为TLSV12,TLSV1的两种模式,则强制执行 TLSv1.2 模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM