instance method
OpenSSL::SSL::SSLContext#ciphers=
(::Array[[ ::String, ::String, ::Integer, ::Integer ]] ciphers) -> void
(::Array[::String] ciphers) -> void
(::String colon_sep_ciphers) -> void
ctx.ciphers = "cipher1:cipher2:..."
ctx.ciphers = [name, ...]
ctx.ciphers = [[name, version, bits, alg_bits], ...]
ext/openssl/ossl_ssl.c
View on GitHub ↗
static VALUE
ossl_sslctx_set_ciphers(VALUE self, VALUE v)
{
SSL_CTX *ctx;
VALUE str;
rb_check_frozen(self);
// Assigning nil is a no-op for compatibility
if (NIL_P(v))
return v;
str = build_cipher_string(v);
GetSSLCTX(self, ctx);
if (!SSL_CTX_set_cipher_list(ctx, StringValueCStr(str)))
ossl_raise(eSSLError, "SSL_CTX_set_cipher_list");
return v;
}
Sets the list of available cipher suites for TLS 1.2 and below for this context.
Note in a server context some ciphers require the appropriate certificates. For example, an RSA cipher suite can only be chosen when an RSA certificate is available.
This method does not affect TLS 1.3 connections. See also ciphersuites=.
See also
#ciphers
#ciphersuites=
#add_certificate
#client_sigalgs=
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0