Rajjy
Rajjy

Reputation: 186

How to debug ssl logs in Node JS

I am having issue issue while connecting to ssl enabled ibm mq using nodejs. I am trying this code with all values replaced as per my MQ. When i execute code i see error MQ call failed in CONNX: MQCC = MQCC_FAILED [2] MQRC = MQRC_HOST_NOT_AVAILABLE [2538]

Keydb i have created using 'runmqakm' utility.

to get ssl logs, i tried setting below system variable before executting Node js code but dont get any logs on console. set NODE_DEBUG='tls' or even set NODE_DEBUG=tls

Can some one please help me to get ssl debug logs

Upvotes: 0

Views: 678

Answers (1)

chughts
chughts

Reputation: 4735

For the Node.js side you need to know which npm modules are being used to determine which settings to use. The ibmmq node library calls the C MQI API, which also takes care of TLS, so a NODE_DEBUG option is not going to help.

Going through the library it looks like you might be able to dynamically switch on logging by calling

const mq = require('ibmmq');
mq.setTuningParameters({debugLog:true});

but the chances are that it's not going to give you much information.

Better would be to check the server logs for an indication of why the connection failed. You can follow the cheat sheet to determine where and what to look for.

https://developer.ibm.com/articles/mq-dev-cheat-sheet/

Most likely it will be because of a cipher mismatch between MQ and app.

If you check the patterns repo, it does describe how to set up TLS - https://github.com/ibm-messaging/mq-dev-patterns

There is also a TLS tutorial - https://developer.ibm.com/tutorials/mq-secure-msgs-tls/

Upvotes: 2

Related Questions