Skip to content

SSLStream should support taking a pre-validated immutable full certificate chain #35844

Closed

Description

@davidfowl

In server scenarios on Linux it's important to support scenarios where the full certificate chain is provided outside of the certificate store (like a PEM file with the full chain). SSlStream should support this so that Kestrel can provide an API for providing the full certificate chain.

As an example, using Lets Encrypt with certbot generates both the SSL cert and a full chain cert. The latter is usually fed into Apache/nginx/haproxy (servers) which avoids the need for any need to retrieve the full chain on demand.

It also works well in container scenarios where the disk cache becomes ephemeral.

See dotnet/aspnetcore#21183 for the latest issue on an example where it was problematic.

Activity

  1. added
    untriaged
    on May 5, 2020
  2. davidfowl commented on May 5, 2020

    @davidfowl
    MemberAuthor

    This fits in with #31944

  3. iamcarbon commented on May 5, 2020

    @iamcarbon

    We've done our own ACME implementation for a reverse proxy and were also given a lot of grief figuring out how to include the full chain. We finally figured it out but also ran into issues loading 5K+ certificates from memory and moved our front proxy to Caddy.

    We'd love to see time invested in making the certificate selection async and ability to load 50K+ certificates with chains into memory (either at startup or lazily during certificate selection).

  4. mholt commented on May 5, 2020

    @mholt

    @iamcarbon I'd like to know more about your deployment. Can I ask details? 😃 (So as not to derail this issue, could I email you? Or vice-versa?)

  5. changed the title [-]SSLStream should support taking an X509Certicate2Collection with a full certificate chain[/-] [+]SSLStream should support taking a pre-validated immutable full certificate chain[/+] on May 17, 2020
  6. removed
    untriaged
    on Jun 16, 2020
  7. added this to the 5.0.0 milestone on Jun 16, 2020
  8. wfurt commented on Jul 20, 2020

    @wfurt
    Member

    Should SslStreamCertificateContext.Create throw if we cannot construct full chain or guarantie operation (on Windows)?
    Or should we proceed as best-effort and possibly send incomplete chain and let client deal with it?
    First option seems invasive but it would make issues more visible.
    (In either case I will add tracing)

  9. vcsjones commented on Jul 20, 2020

    @vcsjones
    Member

    throw if we cannot construct full chain or guarantie operation

    My two cents: no. Clients can still potentially build a valid chain by performing their own AIA fetching, perhaps to a place where a server cannot fetch from. As I have expressed concern before, there is no “singular chain”. A client may end up building a different path, anyway.

    Agree tracing is a useful though.

  10. bartonjs commented on Jul 20, 2020

    @bartonjs
    Member

    As @vcsjones said, even if we're sending a sensible-looking chain there's no guarantee that the other side agrees it's sensible looking... and just because we send something partial doesn't mean it wasn't complete-enough for the remote, so throwing seems bad.

    And, like everyone else, I think tracing seems valuable.

  11. karelz commented on Aug 10, 2020

    @karelz
    Member

    Fixed by #39818

  12. ghost locked as resolved and limited conversation to collaborators on Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions