ibm-messaging / mq-mqi-nodejs

Calling IBM MQ from Node.js - a JavaScript MQI wrapper
Apache License 2.0
79 stars 41 forks source link

Facing SSL_INITIALIZATION_ERROR when updating Key Repository and creating connection with updated Key Repository for each new account #122

Closed prashanthmadduri closed 3 years ago

prashanthmadduri commented 3 years ago

Please include the following information in your ticket.


if (MQDetails.KEY_REPOSITORY) { debug_info('SCO object to locate key repository for TLS'); console.log('SCO object to locate key repository for TLS'); // For TLS let sco = new mq.MQSCO();

sco.KeyRepository = MQDetails.KEY_REPOSITORY;
sco.CertificateLabel = {{$Certificate Label}};

// And make the CNO refer to the SSL Connection Options
cno.SSLConfig = sco;

}

//below is the connection creation mq.Connx(MQDetails.QMGR, cno, function(err, hConn) { if (err) { debug_warn('Error Detected making Connection', err); } else { debug_info("MQCONN to %s successful ", MQDetails.QMGR); } });

Below is the error we are getting:

{"message":"CONNX: MQCC = MQCC_FAILED [2] MQRC = MQRC_SSL_INITIALIZATION_ERROR [2393]","stack":"MQError: CONNX: MQCC = MQCC_FAILED [2] MQRC = MQRC_SSL_INITIALIZATION_ERROR [2393]\n at /root/node_modules/ibmmq/lib/mqi.js:776:17\n at Object. (/root/node_modules/ffi-napi/lib/_foreign_function.js:115:9)","name":"MQError","mqcc":2,"mqccstr":"MQCC_FAILED","mqrc":2393,"mqrcstr":"MQRC_SSL_INITIALIZATION_ERROR","version":"0.9.17","verb":"CONNX"}

ibmmqmet commented 3 years ago

See the MQ documentation about this return code. The underlying MQ client layer (and the TLS package underpinning that) has a process-wide TLS stack. Once initialised, the keystore configuration cannot be changed until all existing connections have been ended.

There's unfortunately nothing that can be done at the level of this package's NodeJS wrapper to override that.

An RFE was recently raised that asks for changes in this area but I am not optimistic that it would be implemented any time soon.

ibmmqmet commented 3 years ago

Closing this as it's not something that can be dealt with in this package.