TlsListener
struct TlsListener
A wrapper around an underlying listener which implements the TLS or SSL protocol.
Implementions
Methods
new
pub fn new(listener: Listener, key: CertifiedKey, keys: <string, CertifiedKey>? = nil, client_auth: ClientAuth = ClientAuth.Off, client_cert_verifier: ClientCertVerifier? = nil, alpn_protocols: [string]? = nil): TlsListener
[src]
pub fn new(
listener: Listener,
key: CertifiedKey,
keys: <string, CertifiedKey>? = nil,
client_auth: ClientAuth = ClientAuth.Off,
client_cert_verifier: ClientCertVerifier? = nil,
alpn_protocols: [string]? = nil
): TlsListener {
let acceptor = TlsAcceptor
.new(key, keys, client_auth as int, client_cert_verifier, alpn_protocols);
return TlsListener { listener, acceptor };
}
Creates a new TLS listener.
new
pub fn new(listener: Listener, key: CertifiedKey, keys: <string, CertifiedKey>? = nil, client_auth: ClientAuth = ClientAuth.Off, client_cert_verifier: ClientCertVerifier? = nil, alpn_protocols: [string]? = nil): TlsListener
[src]
pub fn new(
listener: Listener,
key: CertifiedKey,
keys: <string, CertifiedKey>? = nil,
client_auth: ClientAuth = ClientAuth.Off,
client_cert_verifier: ClientCertVerifier? = nil,
alpn_protocols: [string]? = nil
): TlsListener {
let acceptor = TlsAcceptor
.new(key, keys, client_auth as int, client_cert_verifier, alpn_protocols);
return TlsListener { listener, acceptor };
}
Creates a new TLS listener.
Creates a new TLS listener.
Arguments
listener
: The underlying listener.key
: The server's private key and certificate.keys
: A map of additional keys and certificates to use for SNI.client_auth
: Client authentication mode.client_cert_verifier
: A custom client certificate verifier.alpn_protocols
: A list of ALPN protocols to offer to the peer. Ifnil
, no ALPN negotiation will be attempted.
accept_tls
pub fn accept_tls(self): TlsConnection throws IoError
[src]
pub fn accept_tls(self): TlsConnection throws IoError {
let conn = try self.listener.accept();
return TlsConnection {
tls_conn: try self.acceptor.accept(_create_native_readwrite(conn)),
conn,
};
}
Accepts a new incoming TLS connection from this listener.
accept_tls
pub fn accept_tls(self): TlsConnection throws IoError
[src]
pub fn accept_tls(self): TlsConnection throws IoError {
let conn = try self.listener.accept();
return TlsConnection {
tls_conn: try self.acceptor.accept(_create_native_readwrite(conn)),
conn,
};
}
Accepts a new incoming TLS connection from this listener.
Accepts a new incoming TLS connection from this listener.
accept
pub fn accept(self): Connection throws IoError
[src]
pub fn accept(self): Connection throws IoError {
return try self.accept_tls();
}
accept
pub fn accept(self): Connection throws IoError
[src]
pub fn accept(self): Connection throws IoError {
return try self.accept_tls();
}
[src]
pub fn close(self) throws IoError {
try self.listener.close();
}
[src]
pub fn close(self) throws IoError {
try self.listener.close();
}