Accept an array for cache_tls_allowed_ciphers

The parameter accepts openssl cipher list. Accept an array value and
convert it to the appropriate format to use the native type for easier
handling.

Change-Id: I104225e0153ebe7fad611b463d48f904960a8a7a
This commit is contained in:
Takashi Kajinami 2024-10-08 00:03:21 +09:00
parent cd5216f5a5
commit dfce4a9d13

View File

@ -239,8 +239,12 @@ tls_context.load_cert_chain('<%= @cache_tls_certfile %>', '<%= @cache_tls_keyfil
tls_context.load_cert_chain('<%= @cache_tls_certfile %>')
<% end -%>
<% if @cache_allowed_ciphers -%>
<% if @cache_allowed_ciphers.kind_of?(Array) -%>
tls_context.set_ciphers('<%= @cache_tls_allowed_ciphers.join(":") %>')
<% else -%>
tls_context.set_ciphers('<%= @cache_tls_allowed_ciphers %>')
<% end -%>
<% end -%>
CACHES['default'].setdefault('OPTIONS', {})['tls_context'] = tls_context