public class TlsOptions extends Object:
Immutable TLS options for HTTP clients.
This value object carries peer-verification, trust-store and client certificate settings for HTTPS requests made through HttpClient.
import klyn.net
tls = TlsOptions.clientDefault().withTlsVersions("TLSv1.2", "TLSv1.3")
print(tls.verifyPeer)| Modifier and Type | Member | Description |
|---|---|---|
| public readonly | caFilecaFile as String |
Optional CA certificate file in PEM format. |
| public readonly | caPathcaPath as String |
Optional CA certificate folder. |
| public readonly | clientCertificateFileclientCertificateFile as String |
Optional client certificate file in PEM format. |
| public readonly | clientPrivateKeyFileclientPrivateKeyFile as String |
Optional client private key file in PEM format. |
| public readonly | maxVersionmaxVersion as String |
Optional maximum TLS version, for example `TLSv1. |
| public readonly | minVersionminVersion as String |
Optional minimum TLS version, for example `TLSv1. |
| public readonly | verifyPeerverifyPeer as Boolean |
True when peer certificates and host names must be verified. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | TlsOptions | Creates a TLS configuration for HTTPS requests. |
| Modifier and Type | Member | Description |
|---|---|---|
| public static | clientDefaultclientDefault() as TlsOptions: |
Returns the default verified TLS options. |
| public | copycopy() as TlsOptions: |
Returns a copy of these TLS options. |
| public static | insecureinsecure() as TlsOptions: |
Returns insecure TLS options that disable peer verification. |
| public | trustAlltrustAll() as TlsOptions: |
Returns a copy that trusts all peers. |
| public | withCaFilewithCaFile(value as Object) as TlsOptions throws ProtocolException: |
Returns a copy with a custom CA certificate file. |
| public | withCaPathwithCaPath(value as Object) as TlsOptions throws ProtocolException: |
Returns a copy with a custom CA certificate directory. |
| public | withClientCertificatewithClientCertificate(certificatePath as Object, privateKeyPath as Object) as TlsOptions throws ProtocolException: |
Returns a copy with a client certificate and private key. |
| public | withTlsVersionswithTlsVersions(minVersion as String, maxVersion as String = "") as TlsOptions: |
Returns a copy with minimum and optional maximum TLS versions. |