Contact Free trial Login

Configure the Mutual TLS Authentication - Mule 4

The following example shows how to configure Anypoint Connector for AMQP (AMQP Connector) to connect to an AMQP broker with mutual TLS (mTLS) authentication. To configure the global configuration connection you need:

  • A client truststore that includes the Certificate Authority’s certificates that are required for the server validation.

  • A client keystore that provides the client private key and certificate that are required for the authentication.

  • To enable the parameters Use TLS and Use SNI on the AQMP global configuration in Anypoint Studio.

Configure the Connection

To configure the Mutual TLS authentication connection in Studio, follow these steps:

  1. Navigate to the Global Elements tab and click Create.

  2. In the filter box, type AMQP.

  3. Select AQMP Config.

  4. Click OK.

  5. In the General tab, for the Connection section, set the following parameters:

    • Host: localhost

    • Port: ${rabbitmq.tls.port}

  6. Select the Use tls and Use sni parameters boxes.

  7. Click the TLS tab.

  8. For TLS Configuration select Edit inline.

  9. In the Trust Store Configuration section, set the following parameters:

    • Path: mtls/truststore.jks

    • Password: test

    • Type: JKS

  10. In the Key Store Configuration section, set the following parameters:

    • Type: JKS

    • Path: mtls/test.jks

    • Alias: test

    • Key Password: test

    • keyPassword: test

  11. Click OK.

In Studio, the AMQP global configuration with TLS authentication looks like this:

Configure AMQP Mutual TLS Authentication in global configuration element window
Figure 1. AMQP Mutual TLS Authentication configuration

XML for Configuring Mutual TLS Authentication

In the XML editor, the configuration looks like this:

<amqp:connection host="localhost" port="${rabbitmq.tls.port}" useTls="true" useSasl="true" >
            <tls:context >
                <tls:trust-store path="mtls/truststore.jks" password="test" type="jks" />
                <tls:key-store type="jks" path="mtls/test.jks" alias="test" keyPassword="test" password="test" />
            </tls:context>
</amqp:connection>