Skip to content

Allow choose different crypto backend dynamically #2446

Closed
@taikulawo

Description

@taikulawo

Problem:

background
we have ssl_backend "s2n/rustls" directive to choose ssl crypto impl for different domain

{
    domain "a.com"
    http3 true
    ssl_backend "rustls"
    ssl_certificate ""
    ssl_certificate_key ""
}
{
    domain "b.com"
    http3 true
    ssl_backend "s2n-tls"
    ssl_certificate ""
    ssl_certificate_key ""
}

Current, s2n-quic support rustls/aws-lc-rs, but enable by feature

if #[cfg(feature = "provider-tls-default")] {

which means we can only choose use rustls or aws-lc as compile time.

Solution:

crypto backend should put in Config, to allow use different crypto backend by change Config.
Here are how quinn does. put crypto trait into Config, so we can choose backend by switch Config.

https://github.com/quinn-rs/quinn/blob/6bfd24861e65649a7b00a9a8345273fe1d853a90/quinn-proto/src/endpoint.rs#L611

  • Does this change what s2n-quic sends over the wire?
  • No
  • Does this change any public APIs?
  • maybe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions