0

I am getting the same issue from Azure function 4 with .NET 6 to connect to MQ v9.1 queue manager using IBMMQDotnetClient(9.2.4).

[05/03/2022 14:37:23 > 06c3c9: INFO]       Error occured when trying to establish Queue Manager connection: MQRC_HOST_NOT_AVAILABLE
[05/03/2022 14:37:23 > 06c3c9: INFO]       CompCode: 2, Reason: 2538

Have installed the pfx certificate as per below:

enter image description here

Here is the connection property object creation:

    using IBM.WMQ;    
    private Hashtable GetConnectionProperties()
    {
        var connectionProperties = new Hashtable
        {
            { MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED },
            { MQC.HOST_NAME_PROPERTY, _options.Hostname },
            { MQC.CHANNEL_PROPERTY, _options.Channel },
            { MQC.PORT_PROPERTY, _options.Port },
            { MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_RECONNECT_Q_MGR }
        };
        //options to connect
        if (!string.IsNullOrWhiteSpace(_options.Username))
        {
            connectionProperties.Add(MQC.USER_ID_PROPERTY, _options.Username);
            connectionProperties.Add(MQC.PASSWORD_PROPERTY, _options.Password);
        }
        if(!string.IsNullOrWhiteSpace(_options.CipherSpec))
            connectionProperties.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, _options.CipherSpec); //e.g TLS_RSA_WITH_AES_128_CBC_SHA256
        if (!string.IsNullOrWhiteSpace(_options.CertStore))
        {
            //*USER or *SYSTEM
            connectionProperties.Add(MQC.SSL_CERT_STORE_PROPERTY, _options.CertStore);
            //Certificate friendly name
            connectionProperties.Add(MQC.CERT_LABEL_PROPERTY, _options.CertLabel);
            connectionProperties.Add(MQC.SSL_PEER_NAME_PROPERTY, "CN=XXXXXXX.XXXX.internal");
        }
        if (!string.IsNullOrWhiteSpace(_options.Application))
            connectionProperties.Add(MQC.APPNAME_PROPERTY, _options.Application);

        return connectionProperties;
    }

I tried changing the SSL_CERT_STORE_PROPERTY from *SYSTEM to *USER but still it does not work. I had followed this link earlier Azure Function IBM MQ Setup with pfx Certificate and had replied on the question with same information but somehow it marked hidden by stackoverflow hence creating new post. I had followed the answer but did couldn't able to solve. Can someone please suggest or direct me on this issue as I have limited knowledge on IBM MQ.

Error details on MQ Queue Manager:

04/05/2022 11:37:03 - Process(680.5915) User(svc_mqm) Program(amqrmppa.exe)
                      Host(vmmqXXXXXX) Installation(Installation1)
                      VRMF(9.1.5.0) QMgr(P2CXXXX01)
                      Time(2022-05-04T10:37:03.758Z)
                      CommentInsert1(????)
                      CommentInsert2(680(104))
                      CommentInsert3(10.219.145.39)
    
Channel '????' to host '10.2XX.XXX.XX' ended abnormally.
    
    
The channel program running under process ID 680(104) for channel '????' 
ended abnormally. The host name is '10.219.145.39'; in some cases the host 
name cannot be determined and so is shown as '????'.
       
    
Look at previous error messages for the channel program in the error logs to 
determine the cause of the failure. Note that this message can be excluded 
completely or suppressed by tuning the "ExcludeMessage" or "SuppressMessage" 
attributes under the "QMErrorLog" stanza in qm.ini. Further information can 
be found in the System Administration Guide.
Morag Hughson
  • 7,255
  • 15
  • 44
  • Can you telnet to the mq host and port? Do you see and errors on the queue manager? – JoshMc May 04 '22 at 06:11
  • 1
    Do you see any error in the Queue Manager error logs – subbaraoc May 04 '22 at 06:32
  • Yes, to test the connectivity with MQ Queue manager we had created another QM on same server with username and password authentication. That setup works fine but gets the error when connecting to QM which has TLS certificate. – Dhiraj Bhavsar May 04 '22 at 07:46
  • 1
    What error is seen on the queue manger? – JoshMc May 04 '22 at 08:39
  • Hi JoshMc, subbaraoc, Added the server error logs in the question. – Dhiraj Bhavsar May 04 '22 at 10:47
  • Do you see any other error in the Queue Manager error logs? Were you able to establish a non-TLS connection? – subbaraoc May 04 '22 at 11:48
  • 2
    See where it says in the error message "Look at previous error messages..."? Can you please edit your question to include the previous error message as well. That will be the more interesting one. – Morag Hughson May 05 '22 at 02:28

0 Answers0