The Java buildpack will automatically enable
mutual TLS for most application initiated TLS connections. This functionality is added by the
Container Security Provider, which contributes a
KeyManagerFactory that adds an additional
KeyManager, which in turn adds the Diego Instance ID cert (
$CF_INSTANCE_CERT and $CF_INSTANCE_KEY) for use with outgoing connections.
The Container Security Provider's behavior can be bypassed though. This happens when applications are making TLS connections and not using the default
SSLContext. When bypassed, it is entirely up to the application how the
SSLContext is configured and the application would need to specifically configure use of the Diego Instance ID cert for mutual TLS.
The most notable case where this occurs is when using newer versions of the MySQL JDBC Driver. Newer versions of the 5.1 and 8.0 branches (observed specifically in 5.1.48 & 8.0.18) of the MySQL JDBC Driver exhibit this behavior, creating a custom
SSLContext.