Guest

Untitled

By: a guest on Feb 11th, 2012  |  syntax: None  |  size: 0.71 KB  |  hits: 48  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. ## Working
  2.  
  3. @url              = URI.parse(GATEWAY_ADDRESS)
  4. @http             = Net::HTTP.new(@url.host, @url.port)
  5. @http.use_ssl     = (@url.scheme == 'https')
  6. @http.verify_mode = OpenSSL::SSL::VERIFY_NONE
  7. @request          = Net::HTTP::Get.new('/')
  8. @response         = @http.request(@request)
  9.  
  10. ## Not Working...
  11.  
  12. @url              = URI.parse(GATEWAY_ADDRESS)
  13. @http             = Net::HTTP.new(@url.host, @url.port)
  14. @http.use_ssl     = (@url.scheme == 'https')
  15. @http.verify_mode = OpenSSL::SSL::VERIFY_NONE
  16. @request          = Net::HTTP.get('/')
  17. @response         = @http.request(@request)
  18.  
  19. ## Reason
  20.  
  21. The second doesn't actually use the Net::HTTP object that is configured with the VERIFY_NONE option!