该实例以db2为例,连接ssl认证方式的数据库,我们需要做两步操作:
1. 给DBeaver导入db2证书,在db2数据库找到证书,使用如下命令导入:
keytool -import -trustcacerts -keystore /Applications/DBeaver.app/Contents/Eclipse/jre/Contents/Home/lib/security/cacerts -storepass changeit -alias "ca.crt" -noprompt -import -file /Users/xxxx/Desktop/ca.crt
这里需要注意,这个jre路径是DBeaver安装路径下的jre。
keytool详细教程:keytool证书工具使用 - 简书
2. 重启DBeaver, 在DBeaver连接配置中设置驱动属性,添加一个参数:
sslConnection=true
这会正常连接数据库即可,注意端口号使用ssl的端口号。