Browse Source

Enhancement: Add `:verify_ssl` boolean options to UserAgent request methods.

Thorsten Eckel 4 years ago
parent
commit
33b682400d
1 changed files with 4 additions and 2 deletions
  1. 4 2
      lib/user_agent.rb

+ 4 - 2
lib/user_agent.rb

@@ -318,8 +318,10 @@ returns
 
     if uri.scheme.match?(/https/i)
       http.use_ssl = true
-      # @TODO verify_mode should be configurable
-      http.verify_mode = OpenSSL::SSL::VERIFY_NONE
+
+      if !options.fetch(:verify_ssl, false)
+        http.verify_mode = OpenSSL::SSL::VERIFY_NONE
+      end
     end
 
     http