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

ssl: add verify_hostname option to SSLContext #60

Merged
merged 3 commits into from
Jul 28, 2016

Commits on Jul 10, 2016

  1. Refactor common verify callback code

    There is a function ossl_verify_cb() that fetches the custom callback
    Proc from X509_STORE/X509_STORE_CTX and calls it, but it was not very
    useful for SSL code. It's only used in ossl_x509store.c and ossl_ssl.c
    so move X509::Store specific code to ossl_x509store.c.
    
    Also make struct ossl_verify_cb_args and ossl_call_verify_cb_proc()
    local to ossl.c.
    rhenium committed Jul 10, 2016
    Configuration menu
    Copy the full SHA
    5d73437 View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2016

  1. test/test_ssl: avoid SSLContext#set_params where not required

    Set verify_mode to OpenSSL::SSL::VERIFY_PEER directly. They are tests
    for verify_callback so they don't need to use SSLContext#set_params.
    rhenium committed Jul 23, 2016
    Configuration menu
    Copy the full SHA
    6c387d4 View commit details
    Browse the repository at this point in the history
  2. ssl: add verify_hostname option to SSLContext

    If a client sets this to true and enables SNI with SSLSocket#hostname=,
    the hostname verification on the server certificate is performed
    automatically during the handshake using
    OpenSSL::SSL.verify_certificate_identity().
    
    Currently an user who wants to do the hostname verification needs to
    call SSLSocket#post_connection_check explicitly after the TLS connection
    is established.
    
    This commit also enables the option in SSLContext::DEFAULT_PARAMS.
    Applications using SSLContext#set_params may be affected by this.
    
    [GH ruby#8]
    rhenium committed Jul 23, 2016
    Configuration menu
    Copy the full SHA
    028e495 View commit details
    Browse the repository at this point in the history