public class TLSConfig extends Object
Connection| Modifier and Type | Method and Description |
|---|---|
void |
assertOk() |
static TLSConfig |
auto()
The underlying connection is forced to use TLS.
|
static TLSConfig |
from(File serverCert)
Constructor for establishing a basic TLS connection.
|
File |
getClientCert()
If mTLS is to be used then this should be set to the
certificate of the client.
|
File |
getClientKeyFile()
If mTLS is to be used then this should be set to the
private key of the client.
|
File |
getServerCert()
The servers certificate or some CA that authorized it.
|
static TLSConfig |
mTLS(File serverCert,
File clientCert,
File clientKeyFile)
Constructor for establishing a mTLS connection.
|
public static TLSConfig from(File serverCert)
serverCert - The X509 certificate of the server.public static TLSConfig mTLS(File serverCert, File clientCert, File clientKeyFile)
serverCert - The pem encoded certificate of the server.
Supply 'null' here if the default JVM trust store should
be used for the connection.clientCert - The pem encoded certificate of the clientclientKeyFile - The PEM encoded PKCS#8 private key for the client.public static TLSConfig auto()
See from(File) or mTLS(File, File, File) for configuring
custom trust or mTLS.
public void assertOk()
public File getServerCert()
TlsChannelCredentials.Builder#trustManager(File) for details of the
expected file format.public File getClientCert()
TlsChannelCredentials.Builder#keyManager(File, File) for details of the
expected file format.public File getClientKeyFile()
TlsChannelCredentials.Builder#keyManager(File, File) for details of the
expected file format.Copyright © 2025. All rights reserved.