Skip to content

SNICallback doesn't appear to work with tls.createSecurePair() #4878

Description

@adammw

Test case: https://gist.github.com/adammw/cf4327506d4293e69014

Testing hitting the server with cURL:

curl -v --resolve www.example.com:4443:127.0.0.1 https://www.example.com:4443/

Docs say that there should be two arguments passed to SNICallback, the servername and the callback to call with the secure context. The second argument doesn't appear to be passed through when the TLS connection is created as a stream with tls.createSecurePair().

I get the error:

TypeError: cb is not a function
    at Object.tls.createSecurePair.SNICallback [as onselect]

I note that when removing the callback argument I get an OpenSSL error in my terminal:

Error: 140735169483536:error:1408A0C1:SSL routines:ssl3_get_client_hello:no shared cipher:../deps/openssl/openssl/ssl/s3_srvr.c:1411:

Potentially related PR: #2441 /cc @socketpair

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.tlsIssues and PRs related to the tls subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions