Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support setting SSL client cert as a an array, to configure extra_cha…
…in_cert (#42) * fix test: tap into SSLOptions setting client_cert Tested locally using 3.1.4 and got: warning: Passing only keyword arguments to Struct#initialize will behave differently from Ruby 3.2. Please use a Hash literal like .new({k: v}) instead of .new(k: v). Checked the keyword vs literal on 3.3.4, Yes it behaves differently. irb(main):008> ssl_options_without_literal_hash = Faraday::SSLOptions.new(client_cert: "this is my string") => #<struct Faraday::SSLOptions verify=nil, verify_hostname=nil, ca_file=nil, ca_path=nil, verify_mode=nil, cert_store=nil, client_cert="this is my string", client_key=nil, certificate=nil, private_key=nil, verify_depth=nil, version=nil, min_version=nil, max_version=... irb(main):009> ssl_options_with_literal_hash = Faraday::SSLOptions.new({client_cert: "this is my string"}) => ... irb(main):010> ssl_options_with_literal_hash => verify={:client_cert=>"this is my string"}, verify_hostname=nil, ca_file=nil, ca_path=nil, verify_mode=nil, cert_store=nil, client_cert=nil, client_key=nil, certificate=nil, private_key=nil, verify_depth=nil, version=nil, min_version=nil, max_version=nil> Looked closer at other tests. Thanks for all the good examples. Found a way that should be more compatible: (Well, it worked on my machine with 3.1.4 and 3.3.4 :-D ) let(:ssl_options) do Faraday::SSLOptions.new.tap do |ssl_options| ssl_options.client_cert = cert end end --------- Co-authored-by: Lars Kronfält <lakr@mccc.se>
- Loading branch information