10

When using 'net/https' and ssl, how do I disable verification of the resulting SSL certificate?

4

1 回答 1

20

The following code will disable verification of the certificate. Note that this necessarily implies that invalid certificates will be accepted.

http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl?
于 2009-06-11T17:00:32.083 回答