Currently, I am setting up CA authentication for a java application using qpid jms.
I am happy to say I have gotten everything to work with the connection itself, and the passing of authorized messages between two applications.
Because of future application features, I need the userId to be present in every message that is sent over the connection. The problem is that because I am using certifications and keystores and such, the username field of the connection is never filled in, as the broker simply uses the certificate information to authorize the messages.
I am wondering if there is some way for me to specify keystore info in the broker connection url, without username:password, and have the username from the certificate added to each message sent across the connection. (The userId would populate if I set up the connection with a username, but because only a cert is used for verification, that field is null). For security reasons, I dont want to hardcode the cert's username as the connection username, but pull it from the cert and get it there. I have gotten code to work with manually loading the keystore and parsing the string for the username, but I am scared this solution might not work in the long run, as well as being relatively inefficient. (Looking for say a method in the connection class that will take the keystore info it used in the URL and give me back the username set in the cert in said keystore).
I am using:
Qpid JMS AMQP 0-x 6.4.0
broker: QPID c++ 1.39.0