class

Beryl::TLS::Context::Client

Inherits Beryl::TLS::Context < Reference < Object

Client settings.

context = Beryl::TLS::Context::Client.new # Mozilla roots, verify the name
socket = Beryl::TLS::Socket::Client.new(tcp_socket, context, hostname: "example.com")

Constructors

insecure

A client that skips certificate verification, as OpenSSL::SSL::Context::Client.insecure.

Source

Instance methods

ca_certificates=(path : String) : String

Trusts the certificates in the PEM file at path instead of the Mozilla roots, as OpenSSL::SSL::Context#ca_certificates=.

Source
certificate_chain=(path : String) : String

Reads the PEM certificate chain (leaf first) the client presents when a server asks for a certificate, as OpenSSL::SSL::Context#certificate_chain=.

Source
certificate_verifier

The verifier the handshake uses: set explicitly, or chosen from verify_mode and trust_store.

Source
certificate_verifier=(verifier : CertificateVerifier) : CertificateVerifier
Source
certified_key=(certified_key : CertifiedKey) : CertifiedKey
Source
certified_key?

The chain and key the client presents when a server sends a CertificateRequest, or nil when none is configured (the client then answers with an empty Certificate). Raises Error when only the chain or only the key was set.

Source
is_middlebox_compatible=(is_middlebox_compatible : Bool)

Whether the client uses middlebox compatibility mode (RFC 9846 Appendix D.4): a session id and a change_cipher_spec record.

Source
is_middlebox_compatible?

Whether the client uses middlebox compatibility mode (RFC 9846 Appendix D.4): a session id and a change_cipher_spec record.

Source
is_sending_grease=(is_sending_grease : Bool)

Whether GREASE values (RFC 8701) are sent.

Source
is_sending_grease?

Whether GREASE values (RFC 8701) are sent.

Source
list_of_key_share_groups

The groups the first ClientHello carries a key share for.

Source
list_of_key_share_groups=(list_of_key_share_groups : Array(NamedGroup))

The groups the first ClientHello carries a key share for.

Source
list_of_signature_schemes

The signature schemes accepted in CertificateVerify, in order.

Source
list_of_signature_schemes=(list_of_signature_schemes : Array(SignatureScheme))

The signature schemes accepted in CertificateVerify, in order.

Source
private_key=(path : String) : String

Reads the PEM private key of the client certificate at path (PKCS #8, SEC 1 or PKCS #1), as OpenSSL::SSL::Context#private_key=.

Source
session_cache

The tickets kept for resumption.

Source
session_cache=(session_cache : SessionCache)

The tickets kept for resumption.

Source
trust_store

The roots chains are verified to; the pinned Mozilla set unless set.

Source
trust_store=(trust_store : Certificates::TrustStore) : Certificates::TrustStore
Source
use_system_trust_store

Uses the operating system's bundle of roots.

Source
verify_mode
Source
verify_mode=(mode : VerifyMode) : VerifyMode
Source