我正在使用同一台本地 Windows 7 计算机MQ Client 9.0.4.0
,尝试使用 amqssslc 连接到服务器时,我可以成功连接到 QMGR(像这样连接),但是,当我尝试使用 PyMQI 连接时,出现以下错误,
MQI Error. Comp: 2, Reason 2393: FAILED: MQRC_SSL_INITIALIZATION_ERROR
我正在使用的代码如下,
import pymqi
import logging
import sys, codecs, locale
logging.basicConfig(level=logging.INFO)
queue_manager = 'QMGR'
channel = 'channel'
host = 'server.com'
port = '1414'
conn_info = '%s(%s)' % (host, port)
ssl_cipher_spec = str.encode('TLS_RSA_WITH_AES_256_CBC_SHA256')
key_repo_location = str.encode('T:/Desktop/certificates/key')
message = 'TEST Message'
channel = str.encode(channel)
host = str.encode(host)
conn_info = str.encode(conn_info)
cd = pymqi.CD(Version=pymqi.CMQXC.MQCD_VERSION_11)
cd.ChannelName = channel
cd.ConnectionName = conn_info
cd.ChannelType = pymqi.CMQC.MQCHT_CLNTCONN
cd.TransportType = pymqi.CMQC.MQXPT_TCP
cd.SSLCipherSpec = ssl_cipher_spec
cd.CertificateLabel = 'edgar'.encode()
sco = pymqi.SCO()
sco.KeyRepository = key_repo_location
qmgr = pymqi.QueueManager(None)
qmgr.connect_with_options(queue_manager, cd, sco)
但是amqssslc
,在我的机器上安装 MQ 客户端时,它确实可以正常工作并成功连接。
AMQERR01
日志文件中的错误说明如下,
AMQ9716E: Remote SSL certificate revocation status check failed for channel
'channel_name'.
EXPLANATION:
IBM MQ failed to determine the revocation status of the remote SSL certificate
for one of the following reasons:
(a) The channel was unable to contact any of the CRL servers or OCSP responders
for the certificate.
(b) None of the OCSP responders contacted knows the revocation status of the
certificate.
(c) An OCSP response was received, but the digital signature of the response
could not be verified.
我无法更改我的mqclient.ini
配置文件,因为它因没有管理员权限(公司政策)而被锁定。我觉得奇怪的是amqssslc
,当他们都使用同一个mqclient
文件时,这是可行的。我还尝试将 MQCLTNFC 的路径设置到另一个文件夹,包括不同的配置文件,但没有成功。
任何帮助将不胜感激!