简体   繁体   English

Azure Function 带有 pfx 证书的 IBM MQ 设置

[英]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 证书,它看起来很健康,就像这张图片Azure 函数私钥证书

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.

相关问题 是否可以使用 Azure 逻辑应用程序中的 MQ 连接器中的证书对 IBM MQ 服务器进行身份验证? - Is is possible to authenticate against IBM MQ server using a certificate in the MQ connector within Azure Logic apps? 在Mac上将Azure应用服务证书导出为.pfx - Export Azure App Service Certificate as .pfx on Mac 将带有 ARM 的 pfx 证书部署到 Azure 时出现问题,InternalServerError - Problem deploying pfx certificate with ARM to Azure, InternalServerError Azure webapp ssl证书pfx没有密码 - Azure webapp ssl certificate pfx without password 将 Azure SSL 证书导出为 pfx 文件 - Export Azure SSL certificate as pfx file Azure应用程序网关无法上载pfx证书 - Azure Application gateway cannot upload pfx certificate Azure APIM with certificate authentication error using.pfx certificate - Azure APIM with certificate authentication error using .pfx certificate 带有证书设置的Azure身份验证 - Azure Authentication With Certificate Setup 使用ARM将PFX证书添加到Azure WebApp(不适用于ssl) - Add PFX Certificate to Azure WebApp using ARM (not for ssl) 如何使用中间证书和 pfx 文件在 Azure Application Gateway 中配置 SSL? - How to configure SSL in Azure Application GateWay with intermediate certificate and pfx file?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM