I've already explained the basic concepts in MQ Adapter and SSL - Part 1. This post explains how you can configure your MQ Adapter to use One-way or Two-way SSL. To enable One-way or Two-way SSL on MQ Adapter, following steps need to be followed. I'm outlining the simplest possible steps. Once understood, they can be modified based on your security needs.
- Get the Public certificate (.DER, .CER) of the MQ Server Queue Manager. Ask your MQ server Admin to give this to you.
- Import this certificate into default Weblogic Trust store or you custom keystore if any (all Public certs are stored here because Weblogic trusts the certs imported here) at <WL_HOME>/server/lib/DemoTrust.jks using the following command. You need the keytool utility to execute following commands.
keytool -import -alias <choose_name_for_this_entry> -file <public_cert_received> -keystore DemoTrust.jks -storepass DemoTrustKeyStorePassPhrase
- Verify the imported certificate by running following command. Your entry should be present here.
keytool -list -v -keystore DemoTrust.jks -storepass DemoTrustKeyStorePassPhraseNote: Below 3 steps are required only for configuring Two-way SSL on MQ Adapter. For One-way SSL, you must skip these steps.
For Two-way SSL, you need to provide Weblogic Public certificate to MQ server Admin team so that they can import it in MQ Server's Trust store. Follow the additional 2 steps for Two-way SSL.
1. Extract the PUBLIC certificate of your Weblogic from its identity and give this certficate to MQ Server team.
keytool -export -alias demoidentity -file WLS_PUBLIC_CERT.der -keystore <WL_HOME>\server\lib\DemoIdentity.jks -storepass DemoIdentityKeyStorePassPhrase
2. Ask MQ server Admin to import the given certificate into the Server Trust store being used by the Queue Manager that you connect to.
3. Ensure that the Private key and Identity Keystore passwords of your Keystore are same. Hence, change the keystore password to the Private key password by executing the following command.
keytool -storepasswd -new DemoIdentityPassPhrase -keystore <WL_HOME>\server\lib\DemoIdentity.jks
- Next step is to create a simple BPEL process with MQ Adapter that connects to MQ using a JNDI configured on Weblogic Server. The key to configure SSL on MQ Adapter lies in this JNDI only. To create a JNDI for MQ Adapter, Follow How to create MQ Adapter JNDI .
- Once the JNDI is configured successfully and tested with a dummy BPEL process, edit the following JNDI properties. Remember to hit Enter after updating each property.
S. No
|
Property Name
|
Property Value
|
Description
|
|---|---|---|---|
1
|
channelName
|
<Channel Name>
|
The name of the channel which is of server-conection type. Ask
your MQ Server Admin to provide with this detail. Your process
will connect to this channel.
|
2
|
CipherSuite
|
SSL_RSA_EXPORT_WITH_ RC4_40_MD5
|
Cipher suite that will be used for Message Encryption. Ensure that
this is same as CipherSpec set on the above channel. e.g. for
CipherSpec
to
be
set on
Server
Connection
Channel
for
the
mentioned
CipherSuite
is
RC4_MD5_EXPORT
|
3
|
hostName
|
<Host Name>
|
The host name of the MQ server
|
4
|
KeyStoreLocation
|
<Keystore Location>
|
For One-way SSL, specify this to the location of the keystore in
which you imported the Public certificate of the MQ Server (in our example DemoTrust.jks). This property will be same as TrustStoreLocation in One-way SSL.
However, for Two-way SSL, specify the location of Identity keystore (in our example DemoIdentity,jks) |
5
|
KeyStorePassword
|
<Keystore Password>
|
Specify the password to access the above keystore
|
6
|
KeyStoreType
|
jks
|
By default this is Java Keystore (jks). Ensure you create the
Keystore of the .jks type.
|
7
|
password
|
<Password to access MQ>
|
Specify the password to access the MQ Server
|
8
|
portNumber
|
<MQ Server Port>
|
Network port to connect to MQ server
|
9
|
Protocol
|
TLS
|
The algorigthm used to manage the Keys. Default Value is TLS. Keep
it as it is.
|
10
|
queueManagerName
|
<Queue Manager name on MQ Server>
|
Queue Manager provides access to the queues and also transfers
messages to other queue managers through message channels.
|
11
|
SSLEnable
|
true
|
Set this value to true to tell MQ Adapter to use SSL
|
12
|
TrustStoreLocation
|
<Keystore Location>
|
Provide the Trust keystore location (e.g. /dir/DemoTrust.jks) in which you imported the PUBLIC cert of the MQ Queue Manager.
|
13
|
TrustStorePassword
|
<Keystore Password>
|
Provide the password for Trust Store
|
14
|
userID
|
<username to connect MQ>
|
User Id to access MQ server
|
15
|
XATransaction
|
false
|
By default this is False
|
- Save the properties and Update the Adapter as given in create JNDI post.
Troubleshooting:
- In case you encounter any errors, set the following EXTRA_JAVA_PROPERTIES in setDomainEnv.sh (or setDomainEnv.cmd) file and restart the servers.
set EXTRA_JAVA_PROPERTIES=%EXTRA_JAVA_PROPERTIES% -Dssl.debug=true -Dweblogic.StdoutDebugEnabled=true -Dweblogic.security.SSL.verbose=true
- This will generate verbose logs for SSL to help you diagnose the errors. See the below logs for diagnosis.
<DOMAIN_HOME>/servers/soa_server1/logs/soa_server1.log