From 0b303c683007598a31f2cda3d512d981b278f8bd Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 15 Mar 2023 20:34:21 +0900 Subject: [PATCH] [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 --- test/openssl/test_ssl.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb index c80168f2ff..db76f1dc4c 100644 --- a/test/openssl/test_ssl.rb +++ b/test/openssl/test_ssl.rb @@ -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) } }