lib/go_getter/go_getter.rb in gogetter-0.1.0 vs lib/go_getter/go_getter.rb in gogetter-0.1.1
- old
+ new
@@ -20,10 +20,14 @@
# proxy
klass = (params[:proxy_host] and params[:proxy_port]) ?
Net::HTTP::Proxy(params[:proxy_host], params[:proxy_port], params[:proxy_user], params[:proxy_pass]) : Net::HTTP
- response = klass.start(uri.host, uri.port) do |http|
+ # SSL
+ opt = (uri.scheme == "https") ?
+ { use_ssl: true, verify_mode: OpenSSL::SSL::VERIFY_NONE } : {}
+
+ response = klass.start(uri.host, uri.port, opt) do |http|
http.read_timeout = params.fetch(:read_timeout, 600)
http.request(request)
end
if response.is_a?(Net::HTTPRedirection) # Redirect