[ruby/openssl] Relax error message check for OpenSSL 3.1

A tentative measures fo https://github.com/ruby/openssl/issues/606.

With OpenSSL 3.1.0, the error message at connection using "self-signed
certificate" seems to return `SSL_R_TLSV1_ALERT_UNKNOWN_CA` instead of
`SSL_R_CERTIFICATE_VERIFY_FAILED`.

https://github.com/ruby/openssl/commit/fc4629d246
This commit is contained in:
Nobuyoshi Nakada 2023-03-15 20:34:21 +09:00
parent a6c447d4c5
commit 0b303c6830

View File

@ -1046,9 +1046,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase
start_server(ignore_listener_error: true) { |port|
ctx = OpenSSL::SSL::SSLContext.new
ctx.set_params
# OpenSSL <= 1.1.0: "self signed certificate in certificate chain"
# OpenSSL >= 3.0.0: "self-signed certificate in certificate chain"
assert_raise_with_message(OpenSSL::SSL::SSLError, /self.signed/) {
assert_raise_with_message(OpenSSL::SSL::SSLError, /certificate/) {
server_connect(port, ctx)
}
}