gpt4 book ai didi

.net - 从 .Net MQ 客户端的 Windows 证书存储区获取时的证书标签

转载 作者:太空宇宙 更新时间:2023-11-03 13:25:14 24 4
gpt4 key购买 nike

我已将 KeyStore 设置为 *User 以从 Windows 证书存储中获取证书。Mq 客户端应用程序正尝试使用来自客户端 Trace 的日志中显示的标签名称来查找证书。我尝试从 client.ini 和代码中设置 CertificateLabel,但它并没有覆盖该值。

我应该如何改变它?即使我可以覆盖我如何更改直接导入到我的证书存储中的证书标签?

请帮忙

000001B6 12:23:39.868134 4236.8 Created store object to access certificates 
000001B7 12:23:39.868134 4236.8 Opened store
000001B8 12:23:39.868134 4236.8 Accessing certificate - **ibmwebspheremq(username)**


How should i change the lable in the certificate store for the existing certificate

And then it throws the below exception

000001B9 12:23:39.868134 4236.8 TLS12 supported - True
000001BA 12:23:39.868134 4236.8 Setting SslProtol as Tls
000001BB 12:23:39.868134 4236.8 Starting SSL Authentication
000001BC 12:23:39.868134 4236.8 ------------{ MQEncryptedSocket.FixClientCertificate(Object,String,X509CertificateCollection,X509Certificate,String[])
000001BD 12:23:39.868134 4236.8 Client callback has been invoked to find client certificate
000001BE 12:23:39.868134 4236.8 ------------} MQEncryptedSocket.FixClientCertificate(Object,String,X509CertificateCollection,X509Certificate,String[]) rc=OK
000001BF 12:23:40.507601 4236.8 System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The client and server cannot communicate, because they do not possess a common algorithm

最佳答案

在过去的 2 天里,我刚刚用 MQ v.8 解决了这个完全相同的问题,发现 Shashi 的链接很有帮助,但它并没有完全解决我的问题。除了该链接上的说明之外,您还需要确保商店中证书的“友好名称”符合 MQ 证书标签命名约定,即 ibmwebspheremqlogonuserID .

例如,假设您当前已登录并且您的登录 ID 是 jdoe。当您运行 MQ 客户端时,MQ 客户端库将查找具有与 ibmwebspheremqjdoe 匹配的友好名称的证书。最后我只需要添加下面两个属性就可以连接成功了:

properties.Add(MQC.SSL_CERT_STORE_PROPERTY, "*SYSTEM");
properties.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, "TLS_RSA_WITH_AES_128_CBC_SHA");

请记住,我将 CA 签名证书安装到“本地计算机” keystore 中,而不是用户 keystore 中。这就是我在 SSL_CERT_STORE_PROPERTY 中指定 *SYSTEM 的原因。

以下是我使用的所有属性:

properties = new Hashtable();
properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);
properties.Add(MQC.HOST_NAME_PROPERTY, hostName);
properties.Add(MQC.PORT_PROPERTY, port);
properties.Add(MQC.CHANNEL_PROPERTY, channelName);
properties.Add(MQC.SSL_CERT_STORE_PROPERTY, "*SYSTEM");
properties.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, "TLS_RSA_WITH_AES_128_CBC_SHA");

关于.net - 从 .Net MQ 客户端的 Windows 证书存储区获取时的证书标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34817966/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com