0

Trying to publish and subscribe message from IBM MQ 9 which has Cipher suite, user id, password, mykey.kdb file for SSL connection. we are able to connect through SSL with java. but want to do same thing with node js. While trying to do so we are getting SSL_INITIALISATION_ERROR. In AMQERR01.LOG we are Seeing below error block:

AMQ6090I:MQM could not display text for error 3456322
COMMENTINSERT3(SSLCIPH(' ') -> SSLCIPH(???))

can anyone help me on connecting to MQ using NOde js?

7
  • We have KDB file as well. when we tried importing it, we are are getting " SSL_INITIALISATION_ERROR". I referred below link for code snippet github.com/ibm-messaging/mq-mqi-nodejs/blob/master/samples/… @JoshMc Commented Sep 29, 2020 at 10:10
  • KDB file is named as mykey.kdb Commented Sep 29, 2020 at 10:21
  • Where I can find file "AMQERR01.LOG"@JoshMc Commented Sep 29, 2020 at 10:22
  • its redistributable install @JoshMc Commented Sep 29, 2020 at 10:51
  • I am seeing this in the AMQERR01.LOG "AMQ6090I:MQM could not display text for error 3456322". In the error block I can see below line "COMMENTINSERT3(SSLCIPH(' ') -> SSLCIPH(???)) @JoshMc Commented Sep 29, 2020 at 12:58

1 Answer 1

3

If you have TLS working with Java, then in most likelihood you have the server configured correctly.

To run a Node.js MQ Client in TLS mode needs code that sets the cipher spec and identifies the location of the client keys.

  const KEY_REPOSITORY = "../keys/clientkey";
  const CIPHER = "TLS_RSA_WITH_AES_128_CBC_SHA256";


  var cno = new mq.MQCNO();

  // code that sets up cno object
  // like Options and MQCSP credentials


  var cd = new mq.MQCD();
  // And then fill in relevant fields for the MQCD
  // like ChannelName and ConnectionName

  // If running in TLS Mode 
  cd.SSLCipherSpec = CIPHER;
  cd.SSLClientAuth = MQC.MQSCA_OPTIONAL;


  var sco = new mq.MQSCO();

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

For java you are most likely using a .jks client keystore. For MQI based Clients (Node, Python, Go, C), you need a key database and stash file.

As you will need to have installed the MQI client, you can run the runmqakm tool to create them:


runmqakm -keydb -create -db clientkey.kdb -pw tru5tpassw0rd -type pkcs12 -expire 1000 -stash

and import the server's public key certificate into the client key database

runmqakm -cert -add -label QM1.cert -db clientkey.kdb -pw tru5tpassw0rd -trust enable -file key.crt

Notice that I have called the keystore and stash clientkey. You can call them what ever you want, but in your node.js code set
sco.KeyRepository = KEY_REPOSITORY;

to point at your equivalent of clientkey

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.