[英]Azure Function IBM MQ Setup with pfx Certificate
I am having a connection problem when I am trying to set up a connection to a IBM MQ V6 QueueManager and a .net client using IBM.XMS namespace in Azure Function .当我尝试使用 Azure Z86408593C34AF77FDD2610DF932F85 中的IBM.XMS命名空间来设置与 IBM MQ V6 QueueManager 和 .net 客户端的连接时遇到连接问题。
I am setting up the connection like this:我正在设置这样的连接:
XMSFactoryFactory xff = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
IConnectionFactory cf = xff.CreateConnectionFactory();
cf.SetStringProperty(XMSC.WMQ_HOST_NAME, "servername.ibmcloud.com");
cf.SetIntProperty(XMSC.WMQ_PORT, 1415);
cf.SetStringProperty(XMSC.WMQ_CHANNEL, "SYSTEM.SSL.SVRCONN");
cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT); //Managed Client
cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, "OM_QMGR");
cf.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V1);
cf.SetStringProperty(XMSC.WMQ_CONNECTION_NAME_LIST, "servername.ibmcloud.com(1415)");
cf.SetStringProperty(XMSC.WMQ_SSL_CLIENT_CERT_LABEL, "ibmwebspheremqsystem");
cf.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SPEC, "TLS_RSA_WITH_AES_128_CBC_SHA256");
cf.SetStringProperty(XMSC.WMQ_SSL_KEY_REPOSITORY, "*SYSTEM");
return cf.CreateConnection();
This works properly when I run it in my local machine where pfx certificate is installed in my MMC console.当我在我的 MMC 控制台中安装了 pfx 证书的本地机器上运行它时,它可以正常工作。 Om my local system it is working properly, as it is able to find the WMQ_SSL_KEY_REPOSITORY from "System".
我的本地系统运行正常,因为它能够从“系统”中找到 WMQ_SSL_KEY_REPOSITORY。
I have added the pfx certificate in Azure Function under "Private Key Certificates", and it appears as healthy, just like this Image我在“私钥证书”下的 Azure Function 中添加了 pfx 证书,它看起来很健康,就像这张图片
but when I call the cf.CreateConnection I get an error 2538: MQRC_HOST_NOT_AVAILABLE as an exception.但是当我调用 cf.CreateConnection 时,我收到错误 2538: MQRC_HOST_NOT_AVAILABLE 作为异常。 I know the issue is because of WMQ_SSL_KEY_REPOSITORY property, I am not sure what to provide in place of "*SYSTEM" so that this works properly on Azure Function.
我知道这个问题是因为 WMQ_SSL_KEY_REPOSITORY 属性,我不确定提供什么来代替“*SYSTEM”,以便它在 Azure Function 上正常工作。
Any help regarding this will be appreciated.对此的任何帮助将不胜感激。 Thank you all.
谢谢你们。
This question was solved in the comments by JoshMc.这个问题在 JoshMc 的评论中得到了解决。
The above code works with Azure Function with just one modification.上面的代码只需一项修改即可与 Azure Function 一起使用。 Put
*USER
as the value of XMSC.WMQ_SSL_KEY_REPOSITORY
instead of *SYSTEM
and this should work on Azure Function.将
*USER
作为XMSC.WMQ_SSL_KEY_REPOSITORY
的值而不是*SYSTEM
,这应该适用于 Azure Function。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.