Stack Exchange
Getting error in ruby web crawling for web page with SSL certificate
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'openssl'
OpenSSL.debug=true

#url = "http://www.google.com"    ## Case 1
url = "Confidential"    ## Case 2

#doc = Nokogiri::HTML(open(url))    ## For case 1
doc = Nokogiri::HTML(open(url, :proxy => nil))    ## For case 2
puts doc

Case 1 Output:
I get the output what is expected.
But in Case 2 Output:
OSSL_DEBUG: IS NOW ON!
/usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb:678: warning: error on stack: error:14090086:SSL **routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed**
**/usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb:678:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: error:14090086:SSL** routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (OpenSSL::SSL::SSLError)
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb:678:in `block in connect'
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/timeout.rb:44:in `timeout'
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/timeout.rb:89:in `timeout'
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb:678:in `connect'
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb:637:in `do_start'
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb:626:in `start'
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/open-uri.rb:306:in `open_http'
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/open-uri.rb:769:in `buffer_open'
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/open-uri.rb:203:in `block in open_loop'
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/open-uri.rb:201:in `catch'
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/open-uri.rb:201:in `open_loop'
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/open-uri.rb:146:in `open_uri'
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/open-uri.rb:671:in `open'
        from /usr/local/rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/open-uri.rb:33:in `open'
        from getData.rb:11:in `<main>'


Found the solution to this problem. I just added below line at the beginning of file "OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE"
