fix https cert error

This commit is contained in:
邱博亞 2021-01-11 20:11:02 +08:00
parent 6343fb00d3
commit bd95e242f9
1 changed files with 8 additions and 1 deletions

View File

@ -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