Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
OpenSSL::SSL::SSLContext#options
() -> ::Integer
ctx.options → integer
ext/openssl/ossl_ssl.c
View on GitHub ↗
static VALUE
ossl_sslctx_get_options(VALUE self)
{
SSL_CTX *ctx;
GetSSLCTX(self, ctx);
/*
* SSL_CTX_get_options() returns different types in libssl variants, and
* we want to treat them as a non-negative Integer in Ruby:
* - uint64_t in OpenSSL >= 3
* - unsigned long in OpenSSL >= 1.1
* - long in OpenSSL <= 1.0.2 and LibreSSL 4.3 (latest), with all 32 bits
* used for options.
* - uint32_t in AWS-LC 5.0.0 (latest)
*/
#ifdef OSSL_SIZEOF_SSL_OPTIONS_IS_8
return UINT64T2NUM((uint64_t)SSL_CTX_get_options(ctx));
#else
return UINT2NUM((uint32_t)SSL_CTX_get_options(ctx));
#endif
}
Gets various OpenSSL options.
See also
#options=
#min_version=
#max_version=
#security_level
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0