Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to move keystore into /var/mqm/qmgrs/QM1/ssl #370

Open
seanleblanc opened this issue Sep 25, 2019 · 7 comments
Open

How to move keystore into /var/mqm/qmgrs/QM1/ssl #370

seanleblanc opened this issue Sep 25, 2019 · 7 comments

Comments

@seanleblanc
Copy link

I'm trying to figure out how to properly set up TLS. The instructions I've used to get TLS working have me put the key.kdb file under /var/mqm/qmgrs/QM1/ssl for queue manager QM1, for instance.

The instructions for this image talk about putting key and cert files under /etc. Are these the same thing?

@arthurbarr
Copy link
Contributor

The traditional MQ instructions are for creating a "kdb" file, which is a proprietary key store file used by MQ and some other IBM products. This image adds extra code to help create that file for you: you put standardized key and cert files under /etc, and the Go code in the image will create the "kdb" file for you.

@liz72703
Copy link

I'm struggling with this also.

I've placed my 3 .crt files on a persistent volume called qm1keys.

added to docker run:
--volume qm1keys:/etc/pki/keys/ibmwebspheremqqm1 \

I see the files in /etc/mqm/pki/keys/ibmwebspheremqqm1 inside the running container.

I see the qmgr SSLKEYR(/run/runmqserver/tls/key) attribute has set the keystore location.

I see the keystores were indeed created in: /run/runmqserver/tls.

However, the CERTLABL( ) on the queue manger isn't set to "ibmwebspheremqqm1" and the 3 certs were not imported into the keystore. It's empty.

If I do:
runmqakm -cert -list -db key.kdb -stashed
on the keystore in the container it's empty.

Liz

@parrobe
Copy link
Member

parrobe commented Oct 15, 2019

Hi @liz72703 - What does your container logs say? What are your files called as well? The files need to be named in a particular way for example certificate.crt, certificate.key & ca.crt.

@seanleblanc - The instructions for this repo are relevant to the container image created by the code within. In this code we added a mechanism that if you supply .crt files in a particular way we will automatically generate the kdb fiile for you and configure the queue manager to use it. The other TLS instructions you refer to are likely for general MQ, in which case they are still applicable here and you can place a .kdb file in /var/mqm.... and configure the queue manager to use it. But you couldn't follow the instructions here for an on-premise queue manager.

@liz72703
Copy link

After reflecting on this, I think I'm trying to do something that probably isn't possible or ever intended.

I wanted to set up the keystore with our root/intermediate certificate chain and the personal certificate for the queue manager. But... it wouldn't be possible to even create the personal certificate via the certificate request, until the keystore had been created. I can't see a way to automate this really.

@liz72703
Copy link

If I wanted to supply a prepopulated keystore database with the chain/personal certificate for the qmgr already in it how would I do this?

I'd want to have the keystore sitting on a persistent volume and have the queue managers SSLKEYR and CERTLABL configured for it and not changed again after qmgr creation. Preferably a way to dynamically provide these 2 values so I don't have to bake the mqsc for them into an image specific to one queue manager.

Right now, every time I restart the container, the configureTLS() code runs again and changes those values back to SSLKEYR('/run/runmqserver/tls/key') and CERTLABL(''). At the least, is there a way to disable this?

@arthurbarr arthurbarr added the bug label Oct 17, 2019
@arthurbarr
Copy link
Contributor

There isn't a way at the moment, and I think that's something we need to fix. FYI @sdmarshall79 @parrobe I think that if there are no keys are certs in the "pki" directory, we shouldn't set the SSLKEYR.

@lsabados
Copy link

lsabados commented Oct 17, 2019 via email

mirskifa pushed a commit that referenced this issue Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants