IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only

Using ACE MQ nodes in IBM webMethods Hybrid iPaaS to securely connect to IBM MQ with mTLS via Switch Server

By Jitendra Panda posted 17 hours ago

  

Introduction

In today’s hybrid cloud landscape, securely integrating cloud-native applications with on-premises systems is a critical requirement for enterprises. IBM webMethods Hybrid iPaaS (IWHI) offers a robust and scalable solution to bridge this gap. This document explores how to securely connect IWHI to an on-premises IBM MQ queue manager using TLS encryption, facilitated by a Switch Server for secure port forwarding.

To enable seamless integration, IBM App Connect Enterprise (ACE) plays a key role in orchestrating and managing the connectivity between cloud-based flows and on-premises messaging systems. This approach provides a secure, reliable bridge between cloud and on-premise environments while maintaining end-to-end security.

Configuration overview

Publishing to MQ TLS via the switch server/client

Publishing to MQ TLS via the switch server/client


Publishing to MQ TLS via the switch server/client
This architecture above demonstrates a secure and modular approach to publishing messages to an on-premises IBM MQ server over TLS using a switch server-client tunnelling mechanism. The setup spans three logical zones: ACE Runtime, IBM webMethods Hybrid Integration (IWHI), and the Local Machine. In this scenario, an integration BAR file is deployed in the ACE Runtime within IWHI, containing a message flow that uses the MQOutput Node with TLS/mTLS enabled to initiate secure communication. The IWHI layer hosts both the ACE Runtime and a Switch Server, which acts as a central routing hub. Switch clients from both the ACE Runtime and the Local Machine establish tunnels to this server, enabling secure and dynamic routing of MQ traffic. The MQ connection is initiated to a local port on IWHI and securely forwarded through the switch tunnel to the MQ server. This design decouples ACE from direct MQ access, ensuring secure, scalable, and environment-agnostic message routing—ideal for hybrid cloud environments with restricted network access. Some of the content and scripts referenced here are inspired by Trevor Dolby’s blog post ACE on AWS using Switch, see also: ace-mq-tls-examples.

1. Install IBM MQ

Before we begin configuring IBM MQ for mutual TLS (mTLS), you need to install IBM MQ on your system. If you haven't already done so, please follow the official IBM MQ installation guide here:
IBM MQ Installation Documentation

For this blog post, I’m using IBM MQ version 9.4.0 on Windows.

IBM MQ version 9.4.0 on Windows

2. Create required self-signed certificates and keys

  • Step 1: Create Demo Certificate Authorities
    In this Step Create two self-signed Certificate Authorities (CA1 and CA2) that will be used to sign the MQ server and ACE client certificates respectively.

  • Step 2: Create MQ Server Keys
    Generate a private key and certificate for the MQ server.
    Create a Certificate Signing Request (CSR), signs it with CA1, and packages everything into a PKCS12 (.p12) file that MQ can use.

  • Step 3: Create ACE Client Keys
    Generate a private key and certificate for the ACE client.
    Like the MQ server process, it creates a CSR, signs it with CA2, and packages everything into a PKCS12 (.p12) file that ACE can use.

  • Step 4: Create MQ KDB from P12 and Add CA2
    Convert the MQ server's P12 file to IBM MQ's native KDB format and adds the CA2 certificate to it. This enables the MQ server to trust connections from ACE clients that present certificates signed by CA2. Also creates a stash file (.sth) for password-less access.

  • Step 5: Create ACE KDB from P12 and Add CA1
    Convert the ACE client's P12 file to KDB format and adds the CA1 certificate to it.
    Enable the ACE client to trust connections to MQ servers that present certificates signed by CA1. The script also creates a stash file for password-less access.

  • Step 6: Create Enhanced MQ P12 with CA2
    Create an enhanced PKCS12 file for the MQ server that includes both its own certificate chain and the CA2 certificate. This allows the MQ server to establish mutual TLS connections with ACE clients by having all necessary certificates in one file.

  • Step 7: Create Enhanced ACE P12 with CA1
    Create an enhanced PKCS12 file for the ACE client that includes both its own certificate chain and the CA1 certificate. This allows the ACE client to establish mutual TLS connections with MQ servers by having all necessary certificates in one file.

Generate and Prepare Certificates for IBM MQ & ACE mTLS Setup

#!/bin/bash
# Exit on error
set -e
# Log everything
set -x
# Step 1

mkdir generated-output/ace-demo-CA1
openssl req -x509 -passout pass:mypassword -subj "/C=IN/ST=KA/L=Bangalore/O=IBM/OU=ISL/CN=jk-ace-demo-CA1" -sha256 -days 1825 -newkey rsa:4096 -keyout generated-output/ace-demo-CA1/ace-demo-CA1.key -out generated-output/ace-demo-CA1/ace-demo-CA1.crt
cat generated-output/ace-demo-CA1/ace-demo-CA1.key | openssl rsa -noout -text -passin pass:mypassword
cat generated-output/ace-demo-CA1/ace-demo-CA1.crt | openssl x509 -noout -text
mkdir generated-output/ace-demo-CA2
openssl req -x509 -passout pass:mypassword -subj "/C=IN/ST=KA/L=Bangalore/O=IBM/OU=ISL/CN=jk-ace-demo-CA2" -sha256 -days 1825 -newkey rsa:4096 -keyout generated-output/ace-demo-CA2/ace-demo-CA2.key -out generated-output/ace-demo-CA2/ace-demo-CA2.crt
cat generated-output/ace-demo-CA2/ace-demo-CA2.key | openssl rsa -noout -text -passin pass:mypassword
cat generated-output/ace-demo-CA2/ace-demo-CA2.crt | openssl x509 -noout -text

# Step 2

# CN=mqserver,OU=ISL,O=IBM,L=Bangalore,ST=KA,C=IN
mkdir generated-output/mqserver-keys
openssl req -newkey rsa:4096 -subj "/C=IN/ST=KA/L=Bangalore/O=IBM/OU=ISL/CN=mqserver" -keyout generated-output/mqserver-keys/qm.key -out generated-output/mqserver-keys/qm.csr -passout pass:mypassword
openssl x509 -req -CA generated-output/ace-demo-CA1/ace-demo-CA1.crt -CAkey generated-output/ace-demo-CA1/ace-demo-CA1.key -in generated-output/mqserver-keys/qm.csr -out generated-output/mqserver-keys/qm.crt -days 365 -CAcreateserial -passin pass:mypassword
openssl x509 -in generated-output/mqserver-keys/qm.crt -outform der -out generated-output/mqserver-keys/qm.der
openssl pkcs12 -chain -CAfile generated-output/ace-demo-CA1/ace-demo-CA1.crt -inkey generated-output/mqserver-keys/qm.key -in generated-output/mqserver-keys/qm.crt -export -out generated-output/mqserver-keys/qm.p12 -passin pass:mypassword -passout pass:mypassword -legacy
cat generated-output/mqserver-keys/qm.key | openssl rsa -noout -text -passin pass:mypassword
cat generated-output/mqserver-keys/qm.crt | openssl x509 -noout -text
/opt/mqm/bin/runmqakm -cert -list -db /ace-mq-tls-examples/generated-output/mqserver-keys/qm.p12 -pw mypassword

# Step 3

# CN=aceclient,OU=ExpertLabs,O=IBM,L=Minneapolis,ST=MN,C=US
mkdir generated-output/aceclient-keys
openssl req -newkey rsa:4096 -subj "/C=IN/ST=KA/L=Bangalore/O=IBM/OU=ISL/CN=aceclient" -keyout generated-output/aceclient-keys/aceclient.key -out generated-output/aceclient-keys/aceclient.csr -passout pass:mypassword
openssl x509 -req -CA generated-output/ace-demo-CA2/ace-demo-CA2.crt -CAkey generated-output/ace-demo-CA2/ace-demo-CA2.key -in generated-output/aceclient-keys/aceclient.csr -out generated-output/aceclient-keys/aceclient.crt -days 365 -CAcreateserial -passin pass:mypassword
openssl x509 -in generated-output/aceclient-keys/aceclient.crt -outform der -out generated-output/aceclient-keys/aceclient.der
openssl pkcs12 -chain -CAfile generated-output/ace-demo-CA2/ace-demo-CA2.crt -inkey generated-output/aceclient-keys/aceclient.key -in generated-output/aceclient-keys/aceclient.crt -export -out generated-output/aceclient-keys/aceclient.p12 -passin pass:mypassword -passout pass:mypassword -legacy
cat generated-output/aceclient-keys/aceclient.key | openssl rsa -noout -text -passin pass:mypassword
cat generated-output/aceclient-keys/aceclient.crt | openssl x509 -noout -text
/opt/mqm/bin/runmqakm -cert -list -db generated-output/aceclient-keys/aceclient.p12 -pw mypassword

# Step 4

mkdir generated-output/mq-kdb
/opt/mqm/bin/runmqakm -keydb -convert -pw mypassword -db generated-output/mqserver-keys/qm.p12 -target generated-output/mq-kdb/qm.kdb -new_format kdb -stash
/opt/mqm/bin/runmqakm -cert -add -pw mypassword -db generated-output/mq-kdb/qm.kdb -file generated-output/ace-demo-CA2/ace-demo-CA2.crt
/opt/mqm/bin/runmqakm -cert -list -db generated-output/mq-kdb/qm.kdb -pw mypassword -v

# Step 5

mkdir generated-output/ace-kdb
/opt/mqm/bin/runmqakm -keydb -convert -pw mypassword -db generated-output/aceclient-keys/aceclient.p12 -target generated-output/ace-kdb/aceclient.kdb -new_format kdb -stash
/opt/mqm/bin/runmqakm -cert -add -pw mypassword -db generated-output/ace-kdb/aceclient.kdb -file generated-output/ace-demo-CA1/ace-demo-CA1.crt
/opt/mqm/bin/runmqakm -cert -list -db generated-output/ace-kdb/aceclient.kdb -pw mypassword -v

# Step 6

mkdir generated-output/mq-p12
openssl pkcs12 -chain -certfile generated-output/ace-demo-CA2/ace-demo-CA2.crt -CAfile generated-output/ace-demo-CA1/ace-demo-CA1.crt -inkey generated-output/mqserver-keys/qm.key -in generated-output/mqserver-keys/qm.crt -export -out generated-output/mq-p12/qm-plus-CA2.p12 -passin pass:mypassword -passout pass:mypassword -legacy
/opt/mqm/bin/runmqakm -cert -list -db generated-output/mq-p12/qm-plus-CA2.p12 -pw mypassword

# Step 7

mkdir generated-output/ace-p12
openssl pkcs12 -chain -certfile generated-output/ace-demo-CA1/ace-demo-CA1.crt -CAfile generated-output/ace-demo-CA2/ace-demo-CA2.crt -inkey generated-output/aceclient-keys/aceclient.key -in generated-output/aceclient-keys/aceclient.crt -export -out generated-output/ace-p12/aceclient-plus-CA1.p12 -passin pass:mypassword -passout pass:mypassword -legacy
/opt/mqm/bin/runmqakm -cert -list -db generated-output/ace-p12/aceclient-plus-CA1.p12 -pw mypassword

Note: Certificate Label Note: Readability vs. Technical Accuracy

In this blog, I’ve used the certificate label CN=mqserver,OU=ISL,O=IBM,L=Bangalore,ST=KA,C=IN as-is for the CERTLABL setting in IBM MQ.
While this label is technically valid and works correctly, you can make it more human-readable by either:

  • Renaming the certificate using runmqakm -cert -rename, or
  • Supplying a friendlyName when creating the PKCS12 file.

Certificate Trust Relationship

3. IBM MQ setup commands for mTLS configuration

In this section, we’ll configure IBM MQ to use TLS certificates for secure communication between the server and client, enabling mutual TLS (mTLS).

  • Step 1: Create and Start the Queue Manager
    IBM MQ uses a queue manager to manage queues and channels, acting as the central component for message handling.
    crtmqm JITENDRA_QM                # Create the queue manager
    strmqm JITENDRA_QM                # Start the queue manager
  • Step 2: Configure the Queue Manager
    The runmqsc command allows you to issue MQSC commands to configure and manage the queue manager.
    runmqsc JITENDRA_QM
  • Step 3: Define TLS Key Repository and Certificate Label

    TLS in IBM MQ requires a key repository containing personal and CA certificates for secure communication.

    ALTER QMGR SSLKEYR('C:\generated-output\mq-kdb\qm')
    ALTER QMGR CERTLABL('CN=mqserver,OU=ISL,O=IBM,L=Bangalore,ST=KA,C=IN')
  • Step 4: Define SVRCONN Channel with TLS Settings

    Channels are communication paths in MQ; SVRCONN channels are used by client applications to connect to the queue manager.

    DEFINE CHANNEL('ACE.SVRCONN') CHLTYPE(SVRCONN) SSLCAUTH(REQUIRED)
    SSLCIPH('ANY_TLS13_OR_HIGHER') MCAUSER('MUSR_MQADMIN')
    CERTLABL('CN=mqserver,OU=ISL,O=IBM,L=Bangalore,ST=KA,C=IN')
    SSLPEER('CN=aceclient,OU=ISL,O=IBM,L=Bangalore,ST=KA,C=IN')
  • Step 5: Configure Channel Authentication Rules
    CHLAUTH rules in IBM MQ control which users or certificates are allowed to connect through specific channels.
  • Step 6: Refresh Security Settings

    After modifying authentication settings, you must refresh security to apply the changes.

    ALTER QMGR CONNAUTH(' ')
    REFRESH SECURITY
  • Step 7: Create a Demo Queue

    Queues are used to store messages; a local queue is managed by the queue manager and used for testing or production.

    DEFINE QLOCAL('JITENDRA.QUEUE')
  • Step 8: Display and Verify Configuration

    Use display commands to verify the current configuration of channels, queue manager, and authentication rules.

    DISPLAY CHLAUTH('ACE.SVRCONN')
    DISPLAY CHANNEL('ACE.SVRCONN')
    DISPLAY QMGR
  • Step 9: Stop the Queue Manager (if needed)

    Stopping the queue manager gracefully ensures all resources are released and transactions are completed.

    endmqm -i JITENDRA_QM


Display Queue Manager details

Display Queue Manager details

DIS CHL(ACE.SVRCONN)

DIS CHL(ACE.SVRCONN)

DISPLAY CHLAUTH(ACE.SVRCONN)

DISPLAY CHLAUTH(ACE.SVRCONN)

Note: Platform Note: Windows vs. UNIX/Linux

The IBM MQ setup and commands provided in this blog were tested on Windows. If you're running IBM MQ on UNIX/Linux, please be aware of the following differences:

  • User Permissions:
    On Windows, the default administrative user for MQ is typically MUSR_MQADMIN.
    On UNIX/Linux, this is usually mqm. You should replace MUSR_MQADMIN with mqm (or another appropriate user) in channel and CHLAUTH configurations.
  • File Paths:
    Windows uses backslashes (\) in file paths, while UNIX/Linux uses forward slashes (/). Update paths accordingly when configuring SSLKEYR or referencing certificate files.
  • Command Syntax:
    Most MQSC commands remain the same, but shell commands (e.g., file operations, scripting) may differ between platforms.

Note: At the end of this step my MQ on-premise is ready with mTLS.

Key things to verify at IBM MQ Side:

SSLKEYR('C:\generated-output\mq-kdb\qm')
SSLPEER('CN=aceclient,OU=ISL,O=IBM,L=Bangalore,ST=KA,C=IN')
CERTLABL('CN=mqserver,OU=ISL,O=IBM,L=Bangalore,ST=KA,C=IN')
SSLPEER('CN=aceclient,OU=ISL,O=IBM,L=Bangalore,ST=KA,C=IN')
SSLCAUTH(REQUIRED)
SSLCIPH(ANY_TLS13_OR_HIGHER)

Note: Cipher Suite Note: TLS 1.3 vs. TLS 1.2

In this blog, I’ve used SSLCIPH('ANY_TLS13_OR_HIGHER') to configure the SVRCONN channel for TLS communication.
While TLS 1.3 offers improved security and performance, TLS 1.2 is still widely considered secure and compatible with many enterprise environments.
If you're working in an environment where TLS 1.3 is not supported or you need broader compatibility, you can use:

SSLCIPH('ANY_TLS12_OR_HIGHER')

4. Develop integration BAR file and policy using ACE Toolkit to publish to IBM MQ using ACE MQOutput Node.

Http Input==> Compute ==> MQOutput ==> Http Reply

  • Step 1: Create an integration BAR to publish to IBM MQ
    As part of this step, we create an integration BAR file using the ACE Toolkit, which includes the following nodes: HTTP Input → Compute → MQOutput → HTTP Reply. This flow allows us to publish messages to an IBM MQ queue, and for verification purposes, the same message is also returned in the HTTP Reply node, enabling us to observe the output directly.
    ACE Toolkit showing nodes

  • Step 2: Create an MQ policy which is used by the integration shown above.

    Create an MQ Policy

Note: By the end of this step we have an integration BAR file and policy ready using the ACE Toolkit, which will be deployed in IWHI.

5. Configuration Required on IBM webMethods Hybrid iPaaS (IWHI) Side

  • Step 1: PNA (Private Network Access), switch client configuration
    Uses PNA (Private Network Access) configuration, it includes switchclient.json (named as mq-agent.json in my case) for routing through the Switch Server.
    PNA switch client configuration

    {
      "id": "8b45e2dd-cc8f-44b1-a7d7-4089b87442ef",
      "admin": "disabled",
      "callableFlows": "enabled",
      "listeners": [
        {
          "localPort": 23457,
          "remoteHostname": "localhost",
          "remotePort": 1414
        }
      ],
      "switch": {
        "url": "wss://default-switch-server-switch-acdev2529567.switch.a-vir-d1.appconnect.ipaas.ibmappdomain.cloud:443",
        "certs": {
          "ca": [
            "********"
          ],
          "cert": "*******",
          "key"*******",
          "rejectUnauthorized": true
        }
      },
      "displayName": "mq-test-on-premise"
    }

  • Step 2: Create a generic file configuration with ACE client KDN and sth (mq-via-switch-kdb-generic)
    A configuration using generic files, containing the ACE client KDBS, and the path is /home/aceuser/generic/ace-kdb, provided in the server config.

    Create a generic file

  • Step 3: Create a server config configuration (mq-server-config)
    Create a server config configuration and populate it with the mqKeyRepository location, for ACE to be able to locate the KDB.
    Note: we will find this from the previous step for generic file configuration.

    Create a server config configuration

    Note: Configuring mqKeyRepository in ACE for IBM MQ mTLS

    When setting up mutual TLS (mTLS) between IBM App Connect Enterprise (ACE) and IBM MQ, you can configure the mqKeyRepository in two different ways depending on your certificate format and setup:

    Option 1: Using a .kdb Key Database

    BrokerRegistry:
      mqKeyRepository: '/home/aceuser/generic/ace-kdb/aceclient'

    This points to a CMS key database (.kdb) file, typically used when certificates are managed using IBM's runmqakm or gsk8capicmd tools.

    Option 2: Using a .p12 PKCS#12 File

    BrokerRegistry:
      mqKeyRepository: '/home/aceuser/keystores/aceclient-plus-ca1.p12'
    EnvironmentVariables:
      MQKEYRPWD: 'changeit'
    This configuration uses a PKCS#12 (.p12) file, which is a portable format for storing certificates and private keys. You must also set the MQKEYRPWD environment variable to provide the password for accessing the .p12 file.

  • Step 4: Create a configuration for the policy exported from the ACE Toolkit in IWHI (mq-integration-policy)
    Create a configuration for the policy

  • Step 5: Attach all the ACE configurations to your ACE Runtime
    Attach configurations to ACE runtime

6: Configuration required on On-Prem Secure Agent side

  • Go to IWHI PNA (Private Network Access) in IWHI.
  • For mq-agent(IWHI Secure Agent configuration), click on view setup instructions and follow the steps. For more information see Private Network Agent.
  • Content of switchclient.json values as below.

    switchclient.json

    {
      "id": "8b45e2dd-cc8f-44b1-a7d7-4089b87442ef",
      "admin": "enabled",
      "logLevel": "debug",
      "callableFlows": "enabled",
      "endpoints": [
        {
          "name": "localhost",
          "hostname": "localhost",
          "port": 1414,
          "useTLS": false,
          "certs": {
            "key": "",
            "cert": "",
            "ca": [
              ""
            ],
            "rejectUnauthorized": false
          }
        }
      ],
      "switch": {
        "url": "wss://default-switch-server-switch-acdev2529567.switch.a-vir-d1.appconnect.ipaas.ibmappdomain.cloud:443",
        "certs": {
          "ca": [
            "*******"
          ],
          "cert": "*******",
          "key": "*******",
          "rejectUnauthorized": true
        }
      },
      "displayName": "mq-test-on-premise"
    }

    Note:
    It is important to clarify, although the switchclient.json file shows "useTLS": false under the endpoints section, the overall MQ client connection is still fully secure.

    Here’s how it works, the connection between IBM App Connect Enterprise (ACE) and the on-premises MQ is protected by end-to-end TLS encryption.

    Even though the Switch Client itself doesn’t initiate a TLS handshake with the MQ endpoint (hence "useTLS": false), the MQ client is already configured to use TLS. This means the MQ traffic is encrypted before it enters the secure tunnel created by the Switch Server.

    So in effect, the data is fully encrypted, first by MQ’s own TLS layer, and then again by the secure WebSocket (WSS) tunnel. At no point is the data sent in plaintext. This setup ensures a strong security posture and protects the data throughout its entire journey, both inside and outside the cloud container.

  • Start switch agent (start with debug to view the details only), in realtime configuration debug
    (-d ) should be disabled.

    secureagent.exe -c C:\secureagent-win\switchclient.json -l C:\secureagent-win\log -d
    Start switch agent

7. Verify integration using CURL, and confirm the is published to MQ with       TLS on-premise also the HttpReply.

curl -X POST https://jitendra-mq-tls-https-acdev2529567.a-vir-d1.appconnect.ipaas.ibmappdomain.cloud/putToMQ \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello"}' \
  --output -

HttpReply:

MD ????"MQSTR   ????????{"message": "Hello"}

Data Published to IBM MQ:

Data in IBM MQ


IWHI Activity Log: Connected to MQ Successfully:

IWHI Activity Log


IWHI Flow:

IWHI Flow

Conclusion:

In today’s evolving hybrid cloud landscape, securely connecting cloud-native applications with on-premises systems is not just beneficial—it’s essential. This blog showcased how IBM webMethods Hybrid iPaaS (IWHI), together with IBM App Connect Enterprise (ACE), can be used to build a secure, scalable, and modular integration with an on-premises IBM MQ queue manager.

Using ACE Toolkit, we designed a message flow with nodes like HTTP Input → Compute → MQOutput → HTTP Reply, enabling seamless message publishing to MQ while maintaining visibility through HTTP responses. The integration is further enhanced by the use of a Switch Server and Switch Clients, which establish secure port forwarding between cloud and on-premise environments.

A key advantage of this setup is that the tunnel is initiated via outbound connections from the private network, meaning no inbound firewall ports need to be opened, significantly simplifying network configuration and improving security.

Importantly, the architecture ensures end-to-end TLS encryption, protecting data from the ACE runtime all the way to the MQ server. The MQ client encrypts traffic before it enters the secure tunnel, resulting the data is fully encrypted, first by MQ’s TLS layer and then by the secure WebSocket (WSS) tunnel. This guarantees that data is never transmitted in plaintext, maintaining a strong security posture throughout its journey.

Overall, this approach simplifies hybrid connectivity while meeting enterprise-grade security standards, making it a robust and future-ready solution for modern integration challenges.

0 comments
100 views

Permalink