Skip to content

Commit

Permalink
[ruby/openssl] Relax error message check for OpenSSL 3.1
Browse files Browse the repository at this point in the history
A tentative measures fo ruby/openssl#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`.

ruby/openssl@fc4629d246
  • Loading branch information
nobu committed Mar 16, 2023
1 parent a6c447d commit 0b303c6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions test/openssl/test_ssl.rb
Expand Up @@ -1046,9 +1046,7 @@ def test_connect_certificate_verify_failed_exception_message
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)
}
}
Expand Down

0 comments on commit 0b303c6

Please sign in to comment.