Skip to content

Revise session handling #98

Closed
Closed

Description

@davidben

Conscrypt's session management is not compatible with TLS 1.3 and has bugs around how handshake properties are extracted. (SSL_get_session + session->tlsext_hostname should not be used for extracting the SNI. SSL_get_session also should not be used for adding sessions to the session cache.)

The correct way to do this is to query handshake properties off the SSL (SSL_get_servername) and use a callback (SSL_CTX_sess_set_new_cb) for storing sessions in the session cache. Conscrypt's problems seem to stem from the javax.net.ssl API exposing both SSLSocket.getSession and SSLSocket.getHandshakeSession without actually exposing an external session cache (i.e. it appears that session lookup for client and server is handled internally rather than the caller picking an SSLSession for an SSLSocket).

With an internal session cache, a Java SSLSession should not be backed by SSL_SESSION. It should be a pointer back to the SSLSocket and extract properties off the SSL directly. SSL_SESSION management should be entirely internal and done in the standard way with the callback.

Activity

  1. self-assigned this
    on Feb 27, 2017
  2. modified the milestone: 1.0.1 on Feb 27, 2017
  3. davidben commented on Mar 1, 2017

    @davidben
    CollaboratorAuthor

    Java does provide an SSLSessionContext.getSession API which gets in the way of this, but since the returned SSLSessions aren't useful for anything, always returning null seems a sound choice. At a glance, it appears Netty does this and always makes SSLSocket.getSession and SSLSocket.getHandshakeSession return child objects of the socket as described here.

  4. kruton commented on Mar 21, 2017

    @kruton
    Contributor

    Comments on this unsubmitted CL are relevant.

  5. assigned and unassigned on Apr 4, 2017
  6. modified the milestones: 1.0.0, 1.0.1 on Apr 4, 2017
  7. added a commit that references this issue on Apr 6, 2017
    7bf176b
  8. 4 remaining items

  9. added a commit that references this issue on Apr 16, 2017
    2635b6e
  10. added 9 commits that reference this issue on May 9, 2017
    3aac1ad
    aa808b0
    810d691
    42e4578
    cd6f02f
    4a89276
    29301c5
    af80971
    10c86d4
  11. added 2 commits that reference this issue on Jun 7, 2017
    0bb075a
    98f3316
  12. added a commit that references this issue on Jun 16, 2017
    3c9f16e
  13. added a commit that references this issue on Jun 19, 2017
    f0e05d5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions