Skip to content

HttpClientHandler always set LocalCertificateSelectionCallback delegate in SslOptions #75434

Closed

Description

@wfurt

Besides extra work this prevents TLS resume on Linux so HttpClient won't be able to benefit from #64369

if (sslAuthenticationOptions.IsClient)
{
// We don't support client resume on old OpenSSL versions.
// We don't want to try on empty TargetName since that is our key.
// And we don't want to mess up with client authentication. It may be possible
// but it seems safe to get full new session.
if (!Interop.Ssl.Capabilities.Tls13Supported ||
string.IsNullOrEmpty(sslAuthenticationOptions.TargetHost) ||
sslAuthenticationOptions.CertificateContext != null ||
sslAuthenticationOptions.CertSelectionDelegate != null)
{
cacheSslContext = false;
}

Since the delegate could return different certificate, we would somehow need to track what was actually selected and resume accordingly (if possible)

It seems like the best option wold be not set the delegate unless there is actual need e.g. client certificate is in use.

Activity

  1. ghost added
    untriaged
    on Sep 12, 2022
  2. added
    enhancement
    and removed
    untriaged
    on Sep 27, 2022
  3. added this to the 8.0.0 milestone on Sep 27, 2022
  4. karelz commented on Sep 27, 2022

    @karelz
    Member

    Triage: Would be nice to make sure TLS resume works also with HTTP, not just with SSL.

  5. modified the milestones: 8.0.0, Future on Jun 13, 2023
  6. self-assigned this
    on Jun 27, 2023
  7. ghost added
    in-pr
    on Jun 29, 2023
  8. ghost removed
    in-pr
    on Jul 6, 2023
  9. modified the milestones: Future, 8.0.0 on Jul 16, 2023
  10. ghost locked as resolved and limited conversation to collaborators on Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-System.Net.Httpenhancementtenet-performance

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions