Skip to content
FutureBlitz

    Install

    Import std.net.tls

    TlsServer

    std.net.tls

    class

    Public Class TlsServer

    A server of TLS, which accepts connections over streams with its certificate chain and key, and can ask each client for a certificate that a root it trusts signed.

    std/net/tls.fb, line 316

    • @PanicsAtCaller Public New(chain: Certificate[], key: Key) constructor #

      A server whose certificate is chain's first, which the others signed, up to one a client's root signed, and whose private key is key. Panics when the chain is empty, or a certificate is one mbedTLS can't read, or the key isn't the first certificate's private key, of ECDSA P-256 or RSA, or the first certificate's usages aren't a TLS server's.

    • @PanicsAtCaller Public Method Offer(protocols: String[]) method #

      Picks the first of the application protocols, most wanted first, that a client offers, which the TlsStream's Protocol says, and refuses a client that offers only others. Panics for a name that isn't 1 to 255 bytes, or has a NUL, or names that come to more than 8192 bytes, each with 1 more.

    • @PanicsAtCaller Public Method Identify(chain: Certificate[], key: Key) method #

      Gives connections chain and key from then on, as a renewed certificate is given; those accepted before keep what they had. Panics as New does.

    • Public Method RequireClients(roots: Certificate[]) method #

      Asks each client for a certificate that one of roots signed, and refuses a client without one, from then on.

    • Public Method Accept<S>(stream: S): TlsStream<S> Throws NetError, TimeoutError method #

      TLS over stream, from a client, once the handshake is done.

    • Public Async Method AcceptAsync<S>(stream: S): TlsStream<S> Throws NetError, TimeoutError method #

      Accept's Async twin, which waits on the main thread.

    Report an issue with this page or with FutureBlitz on GitHub.