class

Beryl::TLS::Context::Server

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

Server settings.

context = Beryl::TLS::Context::Server.new
context.certificate_chain = "chain.pem"
context.private_key = "server.key"
context.alpn_protocols = ["h2", "http/1.1"]

Constants

LARGEST_SESSION_TICKET_COUNT = 16

The most tickets a server sends after one handshake.

Constructors

Instance methods

certificate_chain=(path : String) : String

Reads the PEM certificate chain (leaf first) at path.

Source
certified_key

The chain and key the server presents.

Source
certified_key=(certified_key : CertifiedKey) : CertifiedKey
Source
client_ca_certificates=(path : String) : String

Trusts the certificates in the PEM file at path to issue client certificates, as OpenSSL::SSL::Context#ca_certificates= does on a server.

Source
client_certificate_verifier

The verifier client chains go through: set explicitly, or a ClientCertificateVerifier over client_trust_store. Raises an Error when neither is set.

Source
client_certificate_verifier=(verifier : CertificateVerifier) : CertificateVerifier
Source
client_trust_store

The roots client chains are verified to. Never defaults to a public root set: a server that asks for client certificates names the authorities it trusts to issue them.

Source
client_trust_store=(trust_store : Certificates::TrustStore) : Certificates::TrustStore
Source
client_verify_mode

Whether the server asks for a client certificate, and whether one is required. ClientVerifyMode::None (the default) sends no CertificateRequest.

context.client_verify_mode = Beryl::TLS::ClientVerifyMode::Required
context.client_ca_certificates = "clients-ca.pem"
Source
client_verify_mode=(client_verify_mode : ClientVerifyMode)

Whether the server asks for a client certificate, and whether one is required. ClientVerifyMode::None (the default) sends no CertificateRequest.

context.client_verify_mode = Beryl::TLS::ClientVerifyMode::Required
context.client_ca_certificates = "clients-ca.pem"
Source
largest_certificate_authorities_bytesize

The most bytes of distinguished names a CertificateRequest lists in certificate_authorities (RFC 9846 §4.2.4). A client trust store whose subject names take more is not listed, and the client picks its certificate without the hint.

Source
largest_certificate_authorities_bytesize=(largest_certificate_authorities_bytesize : Int32)

The most bytes of distinguished names a CertificateRequest lists in certificate_authorities (RFC 9846 §4.2.4). A client trust store whose subject names take more is not listed, and the client picks its certificate without the hint.

Source
private_key=(path : String) : String

Reads the PEM private key at path (PKCS #8, SEC 1 or PKCS #1).

Source
session_ticket_count

How many tickets the server sends after a full handshake.

Source
session_ticket_count=(count : Int32) : Int32

Sets how many tickets the server sends, from 0 (none) to LARGEST_SESSION_TICKET_COUNT.

Source
session_tickets_enabled?

Whether the server sends session tickets.

Source
ticket_key=(key : Bytes) : Bytes

The 32-byte key session tickets are sealed under. Random per context; set the same key on several processes to let them resume each other's sessions.

Source
ticket_lifetime

The ticket lifetime the server states (and enforces).

Source
ticket_lifetime=(ticket_lifetime : Time::Span)

The ticket lifetime the server states (and enforces).

Source
verify_mode

VerifyMode::Peer when the server asks for a client certificate, else VerifyMode::None.

Source
verify_mode=(mode : VerifyMode) : VerifyMode

Sets the client certificate mode as OpenSSL::SSL::Context::Server takes it: VerifyMode::Peer requires a client certificate (ClientVerifyMode::Required) and VerifyMode::None asks for none.

Source