NAME
Net::mbedTLS::Server::SNICallbackCtx - SNI callback context
SYNOPSIS
my $tls_server = $mbedtls->create_server(
servername_cb => sub {
# This our class instance:
#
my ($sni_cb_ctx) = @_;
# The SNI string that the client sent:
#
my $servername = $sni_cb_ctx->servername();
# Inform the TLS session accordingly:
#
$sni_cb_ctx->set_own_key_and_certs( .. );
$sni_cb_ctx->set_ca_chain( .. );
$sni_cb_ctx->set_authmode( .. );
},
);
DESCRIPTION
This class defines an object given to servername_cb
coderefs (cf. Net::mbedTLS::Server).
METHODS
$name = OBJ->servername()
Returns the servername the client gave in the TLS handshake.
OBJ->set_own_key_and_certs( @KEY_AND_CERTIFICATES )
Sets the key and certificate chain that the TLS server will send to the client.
@KEY_AND_CERTIFICATES may be:
1 item: Concatenated PEM documents.
2+ items: The key, then certificates. Any item may be in PEM or DER format, and any non-initial items (i.e., certificate items) may contain multiple certifictes.
A Net::mbedTLS::X::mbedTLS instance is thrown on failure.
OBJ->set_authmode( $AUTHMODE )
Unneeded unless you’re verifying the client via a TLS certificate.
Configures verification of the client’s certificate. One of the SSL_VERIFY_*
constants.