Проблема в том, что не могу забрать HTML страницу с HTTPS
#!/bin/env ruby
# encoding: utf-8
require 'rubygems'
require 'nokogiri'
require 'net/https'
url = "https://google.com/"
url = URI.parse( url )
http = Net::HTTP.new( url.host, url.port )
http.use_ssl = true if url.port == 443
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if url.port == 443
path = url.path
path += "?" + url.query unless url.query.nil?
res, data = http.get( path )
case res
when Net::HTTPSuccess, Net::HTTPRedirection
# parse link
doc = Nokogiri::HTML(data)
doc.css('head').each do |link|
#render_result.push(link.content)
puts link
end
puts doc
else
return "failed" + res.to_s
end