TlsOptions
classin packageklyn.net
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)
Fields
| Modifier and Type |
Member |
Description |
| public |
TlsOptions(verifyPeer |
Creates a TLS configuration for HTTPS requests. |
| public readonly |
caFile |
Optional CA certificate file in PEM format. |
| public readonly |
caPath |
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 |
maxVersion |
Optional maximum TLS version, for example `TLSv1. |
| public readonly |
minVersion |
Optional minimum TLS version, for example `TLSv1. |
| public readonly |
verifyPeer |
True when peer certificates and host names must be verified. |
Methods
| Modifier and Type |
Member |
Description |
| public static |
clientDefault |
Returns the default verified TLS options. |
| public |
copy |
Returns a copy of these TLS options. |
| public static |
insecure |
Returns insecure TLS options that disable peer verification. |
| public |
trustAll |
Returns a copy that trusts all peers. |
| public |
withCaFile |
Returns a copy with a custom CA certificate file. |
| public |
withCaPath |
Returns a copy with a custom CA certificate directory. |
| public |
withClientCertificate |
Returns a copy with a client certificate and private key. |
| public |
withTlsVersions |
Returns a copy with minimum and optional maximum TLS versions. |