Project

General

Profile

« Previous | Next » 

Revision 12bdacdc

Added by rhenium (Kazuki Yamaguchi) almost 2 years ago

[ruby/openssl] 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>'

https://github.com/ruby/openssl/commit/1c5bbdd68e