简体   繁体   English

使用 SSL 设置 .Net IBM.XMS 客户端到 KDPW

[英]Setting up .Net IBM.XMS client with SSL to KDPW

I am trying to connect to the testing environment in KDPW with NEt IBM.XMS我正在尝试使用 NEt IBM.XMS 连接到 KDPW 中的测试环境

I received a Certificate from KDPW which is store in the Windows certificates store.我收到了来自 KDPW 的证书,该证书存储在 Windows 证书存储中。

I create a KDB file from the received certificate.我从收到的证书创建了一个 KDB 文件。 KDB file is store in the directory C:\\directory. KDB 文件存储在目录 C:\\directory 中。 The name of the KDB file is nameOfKdbFile.kdb KDB 文件的名称是 nameOfKdbFile.kdb

when I try to connect I received error code:当我尝试连接时收到错误代码:

IBM.XMS.XMSException: 'CWSMQ0006E: An exception was received during the call to the method ConnectionFactory.CreateConnection: CompCode: 2, Reason: 2538. During execution of the specified method an exception was thrown by another component. IBM.XMS.XMSException:'CWSMQ0006E:在调用方法 ConnectionFactory.CreateConnection 期间收到异常:CompCode:2,原因:2538。在执行指定方法期间,另一个组件抛出异常。

Can you help me?你能帮助我吗?

Code:代码:

cf.SetStringProperty(XMSC.WMQ_HOST_NAME, "ipAddress");
cf.SetIntProperty(XMSC.WMQ_PORT, port);
cf.SetStringProperty(XMSC.WMQ_CHANNEL, "channel");
cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);
cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, "queueManager");

cf.SetStringProperty(XMSC.WMQ_SSL_PEER_NAME, "peerName");
cf.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SPEC, "cipherSpec");


cf.SetStringProperty(XMSC.WMQ_SSL_KEY_REPOSITORY, @"C:\directory\nameOfKdbFile");
cf.SetStringProperty(XMSC.WMQ_SSL_CLIENT_CERT_LABEL, "ibmwebspheremquserid");

Unmanaged mode is working with settings:非托管模式正在使用设置:

IConnectionFactory cf = factoryFactory.CreateConnectionFactory();


cf.SetStringProperty(XMSC.WMQ_HOST_NAME, "ipAddress");
cf.SetIntProperty(XMSC.WMQ_PORT, port);
cf.SetStringProperty(XMSC.WMQ_CHANNEL, "channel");
cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);
cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, "queueManager");

cf.SetStringProperty(XMSC.WMQ_SSL_PEER_NAME, "peerName");
cf.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SPEC, "cipherSpec");

cf.SetStringProperty(XMSC.WMQ_SSL_KEY_REPOSITORY, @"C:\directory\nameOfKdbFile");
cf.SetStringProperty(XMSC.WMQ_SSL_CLIENT_CERT_LABEL, "ibmwebspheremquserid");

Kdbfile must has 3 parts: .kdb , .rdb and .sth Kdbfile 必须有 3 部分: .kdb.rdb.sth

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

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