public class SecureConnectProvider extends Object implements MtlsProvider
MtlsProvider for the Google Auth library transport layer via ContextAwareMetadataJson. This is only meant to be used internally by Google Cloud libraries,
and the public facing methods may be changed without notice, and have no guarantee of backwards
compatibility.
Note: This implementation is derived from the existing "MtlsProvider" found in the Gax
library, with two notable differences: 1) All logic associated with parsing environment variables
related to "mTLS usage" are omitted - a separate helper class will be introduced in the Gax
library to serve this purpose. 2) getKeyStore throws CertificateSourceUnavailableException instead of returning "null" if this
cert source is not available on the device.
Additionally, this implementation will replace the existing "MtlsProvider" in the Gax library. The Gax library version of MtlsProvider will be marked as deprecated.
| Constructor and Description |
|---|
SecureConnectProvider() |
| Modifier and Type | Method and Description |
|---|---|
KeyStore |
getKeyStore()
Returns a mutual TLS key store backed by the certificate provided by the SecureConnect tool.
|
boolean |
isAvailable()
Returns true if the SecureConnect mTLS provider is available.
|
public KeyStore getKeyStore() throws CertificateSourceUnavailableException, IOException
getKeyStore in interface MtlsProviderCertificateSourceUnavailableException - if the certificate source is unavailable (ex.
missing configuration file).IOException - if a general I/O error occurs while creating the KeyStore.public boolean isAvailable()
throws IOException
isAvailable in interface MtlsProviderIOException - if a general I/O error occurs while determining availability.Copyright © 2026 Google. All rights reserved.