Closed
Description
Upgrading between rustls versions is made more complicated given that all of our TLS code is spread throughout various extensions and source files.
All the rustls-facing code should be in ext/tls, and we should use some lightweight newtype wrappers to insulate ourselves from upstream changes where possible.
The end result of this work will be that rustls
itself will not be visible via crate exports to any code other than in ext/tls
, and all code will use factory functions to create the appropriate ClientConfig
for reqwest
, and TlsStream
s for ext/net
, ext/weboscket
and our test servers.
First TLS work:
- Add
RootCertStore
factory functions toext/tls
-- load a root store from the mozilla roots, the system roots or a CA file. These will be constructed inRootCertStoreProvider
s to avoid the overhead of TLS CA construction until they are used. - Add
RootCertStore
newtype toext/tls
-- an opaque struct that allows us to update rustls in the background. - Make all
rustls-*
exports private fromext/tls
with the exception ofTlsStream
andTlsStream{Read,Write}
and theRootCertStore
newtype - Add
TlsStream
andClientConfig
factory functions toext/tls
. These must support the various options required byext/fetch
(root_cert_store, ca_certs, unsafely_ignore_certificate_errors, client_cert_chain_and_key and ALPN)
Remainder of work:
- Update
file_fetcher.rs
to use RootCertStore fromext/tls
- Migrate
cli/args.rs
to useext/tls
factory functions - Migrate LSP's
language_server.rs
to useext/tls
factory functions - Migrate
cert_tests.rs
to useext/tls
factory functions for certificates and TlsStream - Migrate
ext/net
ops_tls.rs
toext/tls
factory functions - Migrate
ext/net
raw.rs
toext/tls
factory functions - Migrate
ext/websocket
lib.rs
toext/tls
factory functions - Make test_util and test_server depend on
ext/tls
- Migrate
https.rs
grpc.rs
andhyper_utils.rs
intest_util
to useext/tls
factory functions
Activity