Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include "additional data" message in OpenSSL errors #648

Merged
merged 2 commits into from
Aug 16, 2023

Commits on Aug 10, 2023

  1. config: relax test assertions against error messages

    Test that the error message contains the necessary text instead of the
    exact match. Exceptions raised by ossl_raise() may carry additional
    context information in the message.
    rhenium committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    fd6f76c View commit details
    Browse the repository at this point in the history
  2. Include "additional data" message in OpenSSL errors

    Error entries in the OpenSSL error queue may contain additional
    contextual information associated with the error, which can be helpful
    when debugging.
    
    This "additional data" is currently only printed to stderr when
    OpenSSL.debug is enabled. Let's include this in the exception messages
    raised with ossl_raise(), too.
    
    	$ ruby -Ilib -ropenssl -e'OpenSSL.debug=true; OpenSSL::SSL::SSLContext.new.ecdh_curves="P-256:not-a-curve"'
    	-e:1: warning: error on stack: error:0A080106:SSL routines:gid_cb:passed invalid argument (group 'not-a-curve' cannot be set)
    	-e:1:in `ecdh_curves=': passed invalid argument (group 'not-a-curve' cannot be set) (OpenSSL::SSL::SSLError)
    		from -e:1:in `<main>'
    rhenium committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    1c5bbdd View commit details
    Browse the repository at this point in the history