【问题标题】:Certificate Label when fetching from Windows Cert Store for .Net MQ Client从 .Net MQ 客户端的 Windows 证书存储区获取证书标签
【发布时间】:2016-04-21 10:53:54
【问题描述】:

我已将 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

【问题讨论】:

标签: .net ssl ibm-mq mq digital-certificate


【解决方案1】:

在过去的 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 签名证书安装到“本地计算机”密钥库中,而不是用户密钥库中。这就是我在 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");

【讨论】:

  • 感谢您的回复。导入证书存储时如何更改证书标签以匹配 ibmwebspheremqlogonuserID?
  • 您可以在证书上右击,导入后点击“属性”。在“属性”窗口中,您可以更改“友好名称”。
猜你喜欢
  • 1970-01-01
  • 2010-12-11
  • 2011-09-28
  • 1970-01-01
  • 2015-04-17
  • 1970-01-01
  • 2013-02-10
  • 1970-01-01
  • 2015-07-19
相关资源
最近更新 更多