Search code examples
c++sslibm-mq

Connecting mq client to mq server with encrypted channel using C++ API


I have a legacy app accessing MQ Server from an MQ Client using the C++ API. How is this API used to add encryption over the Server Connection Channel? I can't find a location where the certificate is provided to the imqChannel object.


Solution

  • You don't provide any code that is not working to help you with so I can provide only some general direction.

    You specify the cipher like this:

    pchannel->setSslCipherSpecification("TLS_RSA_WITH_AES_256_CBC_SHA256");
    

    You can specify the location of the kdb and sth file like this:
    (note in this example it would expect to find two files, /tmp/key.kdb and /tmp/key.sth)

    manager.setKeyRepository("/tmp/key");
    

    You can also specify the location of the key repository non-programmatically using the mqclient.ini or setting the MQSSLKEYR environment variable, if you are interested in these options comment and I'll expand this answer.