fix https cert error
This commit is contained in:
parent
6343fb00d3
commit
bd95e242f9
|
@ -118,7 +118,14 @@ class Admin::FeedsController < OrbitAdminController
|
|||
url = params['url'].chomp("/") + params[:feed_list_url]
|
||||
uri = URI.parse(url)
|
||||
begin
|
||||
res = Timeout.timeout(10){Net::HTTP.get_response(uri).body}
|
||||
res = Net::HTTP.start(uri.host,
|
||||
uri.port,:use_ssl => uri.scheme == 'https',
|
||||
open_timeout: 10,read_timeout: 10,
|
||||
verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http|
|
||||
req = Net::HTTP::Get.new(uri)
|
||||
http.request(req)
|
||||
end
|
||||
res = res.code=='200' ? res.body : nil
|
||||
rescue
|
||||
res = nil
|
||||
puts uri.to_s
|
||||
|
|
Loading…
Reference in New Issue