2018/05/21

[Ruby] `connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate) (OpenSSL::SSL::SSLError)

証明書を検証をしない方法でエラー抑止

require 'open-uri'
require 'openssl'
puts open('https://www.google.com/', :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE).read

[Ruby] open-uri の HTTPS リクエストで certificate verify failed
http://mofuken.blogspot.jp/2012/12/ruby-open-uri-https-certificate-verify.html

0 件のコメント:

コメントを投稿