Created
August 29, 2016 14:47
-
-
Save anonymous/f5bf2b0d9b9d341bb43f6380e9bf293b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Approach 1 | |
ssl_ctx = OpenSSL::SSL::SSLContext.new() | |
ssl_ctx.verify_mode = OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT | |
ssl_ctx.ca_file = File.join(File.dirname(__FILE__), "cacert.pem") | |
## Approach 2 | |
cert_store = OpenSSL::X509::Store.new | |
cert_store.add_file(File.join(File.dirname(__FILE__), "cacert.pem")) | |
ssl_ctx = OpenSSL::SSL::SSLContext.new() | |
ssl_ctx.cert_store = cert_store |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment