The Cloudflare::CustomHostname::SSLAttribute::Settings class is used to manage SSL-related configuration for custom hostnames. It allows you to control cipher suites, HTTP/2 support, minimum TLS versions, and TLS 1.3 support.
Key Attributes
ciphers: A list of allowed cipher suites.http2: Enables or disables HTTP/2. Use the http2? predicate to check the status.min_tls_version: Sets the minimum allowed TLS version.tls_1_3: Enables or disables TLS 1.3. Use the tls_1_3? predicate to check the status.
Boolean Handling
When setting boolean values (http2= or tls_1_3=), the class internally maps them to Cloudflare's expected string values ("on" or "off"). If you pass nil, the key is removed from the settings entirely. To check the current state, use the predicate methods http2? and tls_1_3?, which return true only if the value is exactly "on".
# Initialize settings
ssl_settings = Cloudflare::CustomHostname::SSLAttribute::Settings.new
# Configure attributes
ssl_settings.ciphers = ["TLS_AES_128_GCM_SHA256"]
ssl_settings.http2 = true
ssl_settings.tls_1_3 = true
ssl_settings.min_tls_version = "1.2"
# Check status using predicates
puts ssl_settings.http2? # => true
puts ssl_settings.tls_1_3? # => true