title: Ruby: Blocking HTTP.new.start and dynamic HTTP(S)
body: <p>I need an application to block an HTTP request so I had to add a couple of lines of code, the only piece I couldn't figure out was the statement <code>if uri.scheme == 'https'; http.use_ssl = true</code> is there a way I can set http/https in the current statement:</p>
  
  <pre><code>Net::HTTP.new(uri.host, uri.port).start do |http|
  
    # Causes and IOError... 
    if uri.scheme == 'https'
      http.use_ssl = true
    end
  
    request = Net::HTTP::Get.new(uri.request_uri)
    http.request(request)
  end
  </code></pre>
  
  <p>Added: <code>IOError: use_ssl value changed, but session already started</code></p>