Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
SSL 验证在某些 HTTP 调用上失败:OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed
但是我们无论如何都希望发出这些请求,如何强制 http.rb 继续进行?
您必须将 ssl_context VERIFY_NONE 传递给您的请求:
ssl_context = OpenSSL::SSL::SSLContext.new ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE HTTP.get(url, ssl_context: ssl_context)