使用SSL证书从spark Scala连接到db2

lztngnrs  于 2022-11-07  发布在  DB2
关注(0)|答案(1)|浏览(174)

我想使用SSL证书从Spark(Scala)代码连接到DB2。请提供连接字符串的格式以及建立连接所需的属性。

krugob8w

krugob8w1#

jdbc:db2://host:port/database:sslConnection=true;sslTrustStoreLocation=/full/path/to/truststore/file;sslTrustStorePassword=truststorePassword;

jdbc:db2://host:port/database:sslConnection=true;sslTrustStoreLocation=/full/path/to/truststore/file;sslTrustStorePassword=truststorePassword;
不要删除URL的结束字符;
请注意,Db2对SSL和非SSL连接使用不同的端口,并且必须在服务器端正确配置SSL支持。
有用的链接:
Configuring connections under the IBM Data Server Driver for JDBC and SQLJ to use TLS
Common IBM Data Server Driver for JDBC and SQLJ properties for all supported database products

相关问题