class

Beryl::TLS::Socket::Server

Inherits Beryl::TLS::Socket < IO::Buffered < IO < Reference < Object

The server end. With accept: true (the default) the handshake runs in the constructor; with accept: false it runs on the first read or write, so a server's accept loop never waits on a slow client.

Constructors

new(io : IO, context : Context::Server, sync_close : Bool = false, accept : Bool = true)
Source

Class methods

open(io : IO, context : Context::Server, sync_close : Bool = false, &)
Source

Instance methods

accept

Runs the handshake now, as OpenSSL::SSL::Socket::Server#accept.

Source
context
Source
hostname

The server name the client sent (SNI), or nil.

Source
list_of_peer_certificates

The client's chain, leaf first, as it sent it; empty when it sent no certificate.

Source
peer_certificate

The client's leaf certificate, verified by the context's Context::Server#client_certificate_verifier; nil when the server asked for none (ClientVerifyMode::None) or the client sent none (ClientVerifyMode::Optional). A resumed connection has the certificate of the session it resumes.

socket.peer_certificate.try(&.subject.to_s) # => "CN=alice"
Source
peer_certificate_chain

Alias of list_of_peer_certificates, named as Socket::Client#peer_certificate_chain.

Source