Skip to content

crypto/tls: use Config.GetCertificate before Config.Certificates, even without SNI #9208

Description

@gopherbot
I'd like to be able to use GetCertificate to dynamically generate a certificate at the
time the request comes in (with caching on top). As is, the code always checks
config.Certificates first, even if it won't be used.

My wish is:

1. GetCertificate would be called even without SNI (no SNI shows up as
ClientHelloInfo.ServerName=="", the docs already talk about this)

2. config.Certificates would be looked at only if GetCertificate returns nil, nil

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions