Rubyでnokogiriを用いてクローラーにスクレイピングにさせてました。
とあるサイトを対象にしたところSSL_connectのエラーが。
早朝にメモしたので少し簡略化して書いてますが、参考になれば。
WindowsでRubyとnokogiri実行中にcertificate verify failed
実行環境
- Windows 8.1
- Ruby 2.1.6
表示されたエラー
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
from C:/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:923:in `block in connect'
from C:/Ruby21-x64/lib/ruby/2.1.0/timeout.rb:76:in `timeout'
from C:/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:923:in `connect'
from C:/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:863:in `do_start'
from C:/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:852:in `start'
from C:/Ruby21-x64/lib/ruby/2.1.0/open-uri.rb:313:in `open_http'
from C:/Ruby21-x64/lib/ruby/2.1.0/open-uri.rb:724:in `buffer_open'
from C:/Ruby21-x64/lib/ruby/2.1.0/open-uri.rb:210:in `block in open_loop'
from C:/Ruby21-x64/lib/ruby/2.1.0/open-uri.rb:208:in `catch'
from C:/Ruby21-x64/lib/ruby/2.1.0/open-uri.rb:208:in `open_loop'
from C:/Ruby21-x64/lib/ruby/2.1.0/open-uri.rb:149:in `open_uri'
from C:/Ruby21-x64/lib/ruby/2.1.0/open-uri.rb:704:in `open'
from C:/Ruby21-x64/lib/ruby/2.1.0/open-uri.rb:34:in `open'
from crawl_check.rb:16:in `'