test bad certs errors with badssl.com instead

This commit is contained in:
HoneyryderChuck 2021-01-31 03:46:28 +00:00
parent 574a478cc8
commit e253a70270

View File

@ -34,11 +34,9 @@ class FaradayTest < Minitest::Test
assert JSON.parse(res.body.to_s)["gzipped"]
end
SYSTEM_CERT_STORE_DIR = "/usr/share/ca-certificates/mozilla"
def test_adapter_get_ssl_fails_with_bad_cert
conn = create_connection(ssl: { ca_path: SYSTEM_CERT_STORE_DIR, verify: OpenSSL::SSL::VERIFY_PEER })
err = assert_raises Faraday::Adapter::HTTPX::SSL_ERROR do
conn.get(build_path("/get"))
get("https://wrong.host.badssl.com/")
end
assert_includes err.message, "certificate"
end