We are getting an exception thrown when attempting to connect to IBM MQ through TLS ({"MQRC_HOST_NOT_AVAILABLE"}) using the .net standard nuget package, IBMMQDotnetClient. The project is using .net framework 4.7.2. We are able to connect without using SSL, and also we are able to connect using SSL when we switch to the .net framework nuget package, WebSphereMQClient, using the exact same code and setup (just swapping out the nuget libraries will allow it to work).
Additionally, I'm not able enable tracing for the .net standard library. The documentation indicates that the environment varable MQDOTNET_TRACE_ON needs to be set, but even after that I'm not getting anything generated. I've tried adding other variables like MQERRORPATH but still not seeing any trace files.
Code
var queueManagerName = "QM1";
var hostName = "hostname.com";
var channel = "DEV.APP.SVRCONN";
var queueName = "DEV.QUEUE.1";
var port = "1414";
var sslKeyRepository = "*USER";
var cipherSpec = "TLS_RSA_WITH_AES_256_CBC_SHA256";
Hashtable prop = new Hashtable();
prop.Add(MQC.HOST_NAME_PROPERTY, hostName);
prop.Add(MQC.PORT_PROPERTY, port);
prop.Add(MQC.CHANNEL_PROPERTY, channel);
prop.Add(MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_RECONNECT);
prop.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);
prop.Add(MQC.SSL_CERT_STORE_PROPERTY, sslKeyRepository);
prop.Add(MQC.SSL_CIPHER_SPEC_PROPERTY, cipherSpec);
try {
var queueManager = new MQQueueManager(queueManagerName, prop);
MQQueue _queue = queueManager.AccessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Error from the client AMQERR01.LOG:
7/16/2021 7:16:12 PM - Process(15212.1) User(Eric.Kaufman) Program(ConsoleApp1)
Host(DLW011309) Installation(Unknown)
VRMF(9.2.2.0)
Time(2021-07-16T23:16:12.121Z)
ArithInsert1(0) ArithInsert2(0)
CommentInsert1(hostname.com(1414))
CommentInsert2(TCP/IP)
CommentInsert3( (Exception))
AMQ9202E: Remote host not available, retry later.
EXPLANATION:
The attempt to allocate a conversation using TCP/IP to host
'hostname.com(1414)' for channel
(Exception) was not successful. However the error may be a transitory one and
it may be possible to successfully allocate a TCP/IP conversation later.
In some cases the remote host cannot be determined and so is shown as '????'.
ACTION:
Try the connection again later. If the failure persists, record the error
values and contact your systems administrator. The return code from TCP/IP is 0
(X'0'). The reason for the failure may be that this host cannot reach the
destination host. It may also be possible that the listening program at host
'hostname.com(1414)' was not running. If
this is the case, perform the relevant operations to start the TCP/IP listening
program, and try again.
Error from queue manager logs
07/16/21 23:16:12 - Process(401.18) User(mqm) Program(amqrmppa)
Host(a55a7574679b) Installation(Installation1)
VRMF(9.2.2.0) QMgr(QM1)
Time(2021-07-16T23:16:12.102Z)
RemoteHost(XXX.XXX.XXX.XXX)
ArithInsert1(420)
CommentInsert1(????)
CommentInsert2(gsk_secure_soc_read)
CommentInsert3(XXX.XXX.XXX.XXX)
AMQ9665E: SSL connection closed by remote end of channel '????'.
EXPLANATION:
The SSL or TLS connection was closed by the remote host 'XXX.XXX.XXX.XXX'
during the secure socket handshake. The channel is '????'; in some cases its
name cannot be determined and so is shown as '????'. The channel did not start.
ACTION:
Check the remote end of the channel for SSL and TLS errors. Fix them and
restart the channel.
----- amqccisa.c : 11155 ------------------------------------------------------
07/16/21 23:16:12 - Process(401.18) User(mqm) Program(amqrmppa)
Host(XXXXXXXXX) Installation(Installation1)
VRMF(9.2.2.0) QMgr(QM1)
Time(2021-07-16T23:16:12.103Z)
CommentInsert1(????)
CommentInsert2(401)
CommentInsert3(XXX.XXX.XXX.XXX)
AMQ9999E: Channel '????' to host 'XXX.XXX.XXX.XXX' ended abnormally.
EXPLANATION:
The channel program running under process ID 401 for channel '????' ended
abnormally. The host name is 'XXX.XXX.XXX.XXX'; in some cases the host name
cannot be determined and so is shown as '????'.
ACTION:
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.