Tuesday, 6 August 2013

Using escape characters to construct a response file for the WAS Manage Profiles command

One of my colleagues asked how he could construct a response file the WAS Manage Profiles command ( manageprofiles.sh ) in order to allow him to enter a Distinguished Name ( DN ) for a personal SSL certificate containing one or more space characters e.g. cn=IBM GB, ou=IBM, o=GB.

The relevant parameter is: -

personalCertDN

It took me a while to work it out, but the WAS Information Center was of great use: -


which says: -

When you specify a single value that contains a comma character, such as the distinguished names for the personalCertDN and signingCertDN parameters, use a double-backslash before the comma character. For example, here is how to specify the personalCertDN value with a distinguished name:

signingCertDN=cn=testserver.ibm.com\\,ou=Root Certificate\\,  ou=testCell\\,ou=testNode01\\,o=IBM\\,c=US 

Here's my version: -

create
profileName=foobar1
nodeName=foobar1
hostName=rhel6.uk.ibm.com
cellName=snafu1
profilePath=/opt/IBM/WebSphere/AppServer/profiles/foobar1
templatePath=/opt/IBM/WebSphere/AppServer/profileTemplates/BPM/managed.procctr
federateLater=true
dbJDBCClasspath=/opt/IBM/WebSphere/AppServer/jdbcdrivers/DB2
dbType=DB2_DATASERVER
personalCertValidityPeriod=15
signingCertValidityPeriod=15
keyStorePassword=b0nf1re!
personalCertDN=cn=IBM GB\\, ou=IBM\\, o=GB
signingCertDN=cn=IBM GB\\, ou=IBM\\, o=GB

The Unix ( Linux in my case ) OS converts \\ to \ and the Java Virtual Machine ( manageprofiles uses Java under the covers ) uses the single \ character to "escape" the required space character.

Seemples …..

No comments:

Note to self - use kubectl to query images in a pod or deployment

In both cases, we use JSON ... For a deployment, we can do this: - kubectl get deployment foobar --namespace snafu --output jsonpath="{...