instance method
OpenSSL::SSL::SSLSocket#alpn_protocol
() -> ::String?
ssl.alpn_protocol => String | nil
ext/openssl/ossl_ssl.c
View on GitHub ↗
static VALUE
ossl_ssl_alpn_protocol(VALUE self)
{
SSL *ssl;
const unsigned char *out;
unsigned int outlen;
GetSSL(self, ssl);
SSL_get0_alpn_selected(ssl, &out, &outlen);
if (!outlen)
return Qnil;
else
return rb_str_new((const char *) out, outlen);
}
Returns the ALPN protocol string that was finally selected by the server during the handshake.