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 ssl_options) -> ::Integer
ctx.options = integer
ext/openssl/ossl_ssl.c
View on GitHub ↗
static VALUE
ossl_sslctx_set_options(VALUE self, VALUE options)
{
SSL_CTX *ctx;
rb_check_frozen(self);
GetSSLCTX(self, ctx);
#ifdef OSSL_SIZEOF_SSL_OPTIONS_IS_8
uint64_t opts = NIL_P(options) ? SSL_OP_ALL : NUM2UINT64T(options);
#else
uint32_t opts = NIL_P(options) ? SSL_OP_ALL : NUM2UINT(options);
#endif
SSL_CTX_clear_options(ctx, SSL_CTX_get_options(ctx));
SSL_CTX_set_options(ctx, opts);
return self;
}
Sets various OpenSSL options. The options are a bit field and can be combined with the bitwise OR operator (|). Available options are defined as constants in OpenSSL::SSL that begin with OP_.
For backwards compatibility, passing nil has the same effect as passing OpenSSL::SSL::OP_ALL.
See also man page SSL_CTX_set_options(3).
See also
#options
#security_level
#min_version=
#security_level=
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0