Skip to content

Commit

Permalink
test/openssl/test_ossl.rb: relax assertion for error messages
Browse files Browse the repository at this point in the history
The test case test_error_data utilizes the error message generated by
X509V3_EXT_nconf_nid(). The next commit will use X509V3_EXT_nconf(),
which generates a slightly different error message. Let's adapt the
check to it.
  • Loading branch information
rhenium committed Aug 31, 2023
1 parent 7c34a43 commit 5394dd5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/openssl/test_ossl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ def test_error_data
#
# The generated message should look like:
# "subjectAltName = IP:not.a.valid.ip.address: bad ip address (value=not.a.valid.ip.address)"
# "subjectAltName = IP:not.a.valid.ip.address: error in extension (name=subjectAltName, value=IP:not.a.valid.ip.address)"
ef = OpenSSL::X509::ExtensionFactory.new
assert_raise_with_message(OpenSSL::X509::ExtensionError, /\(value=not.a.valid.ip.address\)/) {
assert_raise_with_message(OpenSSL::X509::ExtensionError, /\(value=(IP:)?not.a.valid.ip.address\)/) {
ef.create_ext("subjectAltName", "IP:not.a.valid.ip.address")
}
end
Expand Down

0 comments on commit 5394dd5

Please sign in to comment.