Commit Graph

12 Commits

Author SHA1 Message Date
Martin Algesten
50fd1fe14e Update deps 2023-08-11 09:21:10 +02:00
Harald Hoyer
4a2ecdf123 fix: pass IPv6 addresses as host name in TLS connections
rustls does not like the brackets `[]` in `rustls::ServerName::try_from()`.

Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
2023-06-27 00:26:21 +02:00
Jacob Hoffman-Andrews
cf687381bd Don't panic when rustls-native-certs errors (#564)
Fixes #563
2022-11-30 22:12:48 -08:00
Jacob Hoffman-Andrews
9908c446d6 Simplify ReadWrite interface (#530)
Previously, ReadWrite had methods `is_poolable` and `written_bytes`, which
were solely for the use of unittests.

This replaces `written_bytes` and `TestStream` with a `struct Recorder`
that implements `ReadWrite` and allows unittests to access its recorded
bytes via an `Arc<Mutex<Vec<u8>>>`. It eliminates `is_poolable`; it's fine
to pool a Stream of any kind.

The new `Recorder` also has some convenience methods that abstract away
boilerplate code from many of our unittests.

I got rid of `Stream::from_vec` and `Stream::from_vec_poolable` because
they depended on `TestStream`. They've been replaced by `NoopStream` for
the pool.rs tests, and `ReadOnlyStream` for constructing `Response`s from
`&str` and some test cases.
2022-07-09 10:13:44 -07:00
Martin Algesten
4675d748e9 Remove Sync bound from TlsConnector io arg 2022-05-07 14:39:59 +02:00
Martin Algesten
049b5a5acd Fixes after feedback 2022-05-07 14:39:59 +02:00
Martin Algesten
65371c966c Box<dyn ReadWrite> for TlsConnector::connect 2022-05-07 14:39:59 +02:00
Martin Algesten
6e5041044b Rename trait HttpsStream -> ReadWrite and make it public
Also provide an example of how to use it.
2022-01-22 10:41:22 +01:00
Martin Algesten
8f476e9d29 cargo fmt 2021-12-19 21:17:26 +01:00
Martin Algesten
d1a2c630f5 Update src/rtls.rs
Co-authored-by: Jacob Hoffman-Andrews <github@hoffman-andrews.com>
2021-12-19 21:17:26 +01:00
Martin Algesten
f3857eed00 Ensure we provide a Transport::message() when we can 2021-12-19 21:17:26 +01:00
Jacob Hoffman-Andrews
56276c3742 Add support for alternate TLs implementations. 2021-12-17 17:47:30 +01:00