Skip to content

Instantly share code, notes, and snippets.

@juliofalbo
Created September 19, 2021 20:42
Show Gist options
  • Save juliofalbo/e06a303e9ed759b70223f47170fecf7b to your computer and use it in GitHub Desktop.
Save juliofalbo/e06a303e9ed759b70223f47170fecf7b to your computer and use it in GitHub Desktop.
# The value of ssl_verify_callback is assigned to Net::HTTP#verify_callback
response = RestClient::Resource.new(
'https://localhost?q=Foo',
:ssl_client_cert => OpenSSL::X509::Certificate.new(File.read(ssl_client_cert)), # Part of the Client Certificate Validation
:ssl_client_key => OpenSSL::PKey::RSA.new(File.read(ssl_client_key), key_pass), # Part of the Client Certificate Validation
:ssl_ca_file => ssl_ca_file, # Part of the Client Certificate Validation
:verify_ssl => OpenSSL::SSL::VERIFY_PEER, # Part of the Client Certificate Validation
:ssl_verify_callback => lambda(&method(:ssl_verify_callback)) # Part of the Client Certificate Validation
).get
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment