擅长:python、mysql、java
<p>在Db2客户机工作站上,可以避免将GSK8作为单独的组件进行安装/配置,并且仍然具有到db2luw服务器的加密SSL连接。在</p>
<p>注意,出于其他原因(其他非Db2应用程序),您可能需要在客户机工作站上使用GSK8,但这是另一回事。在</p>
<p>在mswindows上,有两种方法可以避免为db2ssl连接安装GSK8,但是在这个答案中我提到了一种方法。在</p>
<p>从技术上讲,这个特性在V10.5fixpack5db2客户机上可用,但是有一些bug,所以我建议避免使用fixpack,从fixpack8或更高版本开始。这个功能也适用于V11.1db2客户机。在</p>
<p>如果您有ARM格式的服务器证书,那么可以使用SSLSERVERCERTIFICATE和连接字符串中的SECURITY关键字从Python(或任何使用db2cli库的工具)连接SSL。在</p>
<p>使用这种方法,您不需要手动创建密钥库和存储库,也不需要在连接字符串中使用sslclientkeysteredb等。在</p>
<p>您仍然需要为ARM文件在静态和分发期间添加适当的安全性。在</p>
<p>这种方法可能更易于管理,下面是连接示例:</p>
<pre><code>try:
arg1="DATABASE=whatever;HOSTNAME=whatever;PORT=50443;UID=whavever;PWD=whatever;SSLServerCertificate=/path_to/db2server_instance.arm;SECURITY=ssl;"
conn = ibm_db.connect(arg1,"","")
except:
logging.error('Error: Failed to connect to database: %s', ibm_db.conn_errormsg())
sys.exit(1)
</code></pre>