Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSSL: deprecate Mozilla's TLS Server recommendation #14657

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scripts/generate_ssl_server_defaults.cr
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ File.open(DEFAULTS_FILE, "w") do |file|
# available at #{guidelines.href}.
#
# See https://wiki.mozilla.org/Security/Server_Side_TLS for details.
@[Deprecated("Deprecated with no replacement. Prefer setting a security level, global system configuration, or build your own from #{url}")]
ysbaddaden marked this conversation as resolved.
Show resolved Hide resolved
CIPHERS_#{level.upcase} = "#{all_ciphers.join(":")}"

# The list of secure ciphersuites on **#{level}** compatibility level as per Mozilla
Expand All @@ -68,6 +69,7 @@ File.open(DEFAULTS_FILE, "w") do |file|
# available at #{guidelines.href}.
#
# See https://wiki.mozilla.org/Security/Server_Side_TLS for details.
@[Deprecated("Deprecated with no replacement. Prefer setting a security level, global system configuration, or build your own from #{url}")]
CIPHER_SUITES_#{level.upcase} = "#{ciphersuites.join(":")}"
CRYSTAL
end
Expand Down
36 changes: 15 additions & 21 deletions src/openssl/ssl/context.cr
Original file line number Diff line number Diff line change
Expand Up @@ -320,36 +320,30 @@ abstract class OpenSSL::SSL::Context
end

# Sets the current ciphers and ciphers suites to **modern** compatibility level as per Mozilla
# recommendations. See `CIPHERS_MODERN` and `CIPHER_SUITES_MODERN`. See `#security_level=` for some
# sensible system configuration.
# recommendations. See `#security_level=` for some sensible system configuration.
#
# WARNING: Does nothing as of Crystal 1.13.
# WARNING: Didn't work as expected as of OpenSSL 1.1 (didn't configure TLSv1.2 and below).
@[Deprecated("Deprecated with no replacement. Prefer #security_level, global system configuration or build your own from https://wiki.mozilla.org/Security/Server_Side_TLS")]
def set_modern_ciphers
{% if LibSSL.has_method?(:ssl_ctx_set_ciphersuites) %}
self.cipher_suites = CIPHER_SUITES_MODERN
{% else %}
self.ciphers = CIPHERS_MODERN
{% end %}
end

# Sets the current ciphers and ciphers suites to **intermediate** compatibility level as per Mozilla
# recommendations. See `CIPHERS_INTERMEDIATE` and `CIPHER_SUITES_INTERMEDIATE`. See `#security_level=` for some
# sensible system configuration.
# recommendations. See `#security_level=` for some sensible system configuration.
#
# WARNING: Does nothing as of Crystal 1.13.
# WARNING: Didn't work as expected as of OpenSSL 1.1 (didn't configure TLSv1.2 and below).
@[Deprecated("Deprecated with no replacement. Prefer #security_level, global system configuration or build your own from https://wiki.mozilla.org/Security/Server_Side_TLS")]
def set_intermediate_ciphers
{% if LibSSL.has_method?(:ssl_ctx_set_ciphersuites) %}
self.cipher_suites = CIPHER_SUITES_INTERMEDIATE
{% else %}
self.ciphers = CIPHERS_INTERMEDIATE
{% end %}
end

# Sets the current ciphers and ciphers suites to **old** compatibility level as per Mozilla
# recommendations. See `CIPHERS_OLD` and `CIPHER_SUITES_OLD`. See `#security_level=` for some
# sensible system configuration.
# recommendations. See `#security_level=` for some sensible system configuration.
#
# WARNING: Does nothing as of Crystal 1.13.
# WARNING: Didn't work as expected as of OpenSSL 1.1 (didn't configure TLSv1.2 and below).
@[Deprecated("Deprecated with no replacement. Prefer #security_level, global system configuration or build your own from https://wiki.mozilla.org/Security/Server_Side_TLS")]
def set_old_ciphers
{% if LibSSL.has_method?(:ssl_ctx_set_ciphersuites) %}
self.cipher_suites = CIPHER_SUITES_OLD
{% else %}
self.ciphers = CIPHERS_OLD
{% end %}
end

# Returns the security level used by this TLS context.
Expand Down
8 changes: 7 additions & 1 deletion src/openssl/ssl/defaults.cr

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading