instance method
OpenSSL::SSL::SSLSocket#hostname=
(::String) -> ::String
ssl.hostname = hostname → hostname
ext/openssl/ossl_ssl.c
View on GitHub ↗
static VALUE
ossl_ssl_set_hostname(VALUE self, VALUE arg)
{
SSL *ssl;
char *hostname = NULL;
GetSSL(self, ssl);
if (!NIL_P(arg))
hostname = StringValueCStr(arg);
if (!SSL_set_tlsext_host_name(ssl, hostname))
ossl_raise(eSSLError, NULL);
/* for SSLSocket#hostname */
rb_ivar_set(self, id_i_hostname, arg);
return arg;
}
Sets the server hostname used for SNI. This needs to be set before SSLSocket#connect.
See also
#group
#npn_protocol
#finished_message
#peer_cert
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0