url = 'http://coffeescript.org/'
url = url.sub('http:', 'https:')
uri = URI(url)
Net::HTTP.get(uri)
# OK
url = 'http://coffeescript.org/'
uri = URI(url)
uri.scheme = 'https'
Net::HTTP.get(uri)
# OpenSSL::SSL::SSLSocket#connect_nonblock': SSL_connect returned=1 errno=0 peeraddr=... state=error: record layer failure