Commit 6c0a2048 authored by MARGERY David's avatar MARGERY David
Browse files

Implement support for tls options (bug #8379)

With this commit, the following tls options are supported and used if
present in the configuration file
- uri_out_cert_chain_file
- uri_out_private_key_file
- uri_out_verify_peer
- uri_out_fail_if_no_peer_cert
- uri_out_cipher_list
- uri_out_ecdh_curve
- uri_out_dhparam
- uri_out_ssl_version

- uri_in_cert_chain_file
- uri_in_private_key_file
- uri_in_verify_peer
- uri_in_fail_if_no_peer_cert
- uri_in_cipher_list
- uri_in_ecdh_curve
- uri_in_dhparam
- uri_in_ssl_version
parent 5355d08e
......@@ -96,6 +96,18 @@ module Grid5000
Rails.my_config("base_uri_#{in_or_out}".to_sym)
end
end
def tls_options_for(url, in_or_out = :in)
tls_options={}
[:cert_chain_file, :private_key_file, :verify_peer, :fail_if_no_peer_cert,
:cipher_list, :ecdh_curve, :dhparam, :ssl_version].each do |tls_param|
config_key=("uri_#{in_or_out.to_s}_"+tls_param.to_s).to_sym
if Rails.my_config(config_key)
tls_options[tls_param]=Rails.my_config(config_key)
end
end
tls_options
end
end
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment