You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found this while trying to connect to a server with self signed certs. I did
transport_options = {
ssl: {
verify: false
}
which didn't seem to have any affect (so I spent an hour or two trying different things - none seemed to make any difference).
I finally started digging into the library and found this little gem:
def api_key(arguments)
api_key = if arguments[:api_key].is_a? Hash
encode(arguments[:api_key])
else
arguments[:api_key]
end
arguments.delete(:user)
arguments.delete(:password)
authorization = { 'Authorization' => "ApiKey #{api_key}" }
if (headers = arguments.dig(:transport_options, :headers))
headers.merge!(authorization)
else
arguments[:transport_options] = {
headers: authorization
}
end
end
In particular, "if (headers = arguments.dig(:transport_options, :headers))" will return nil if :headers is not defined, and once it does that it just completely overwrites the stuff I passed in with headers: authorization.