Commit Graph

29 Commits

Author SHA1 Message Date
0x676e67 231010c0cb Merge remote-tracking branch 'upstream/master' 2025-10-21 12:35:13 +08:00
Kornel 9bad96e48b Style nits 2025-09-26 13:33:19 +01:00
0x676e67 109c35839c chore: fix ci and docs 2025-07-07 21:32:45 +08:00
Kornel 5fa9c81c88
Sprinkle #[must_use] (#368) 2025-06-05 20:40:35 +01:00
Kornel 4d178a7f9f Clippy 2025-06-05 10:16:08 +01:00
Kornel 3ab8b53532 rustfmt ;( 2025-05-26 16:30:09 +01:00
Kornel 23863ffd1b Clippy 2025-05-26 16:30:09 +01:00
Kevin Guthrie bc42edc552 Introduce and use read_uninit and write_uninit duplicated from openssl-0.10.61 and tokio-openssl-0.6.4 2024-02-21 09:07:39 +01:00
Anthony Ramine 446b65550a Introduce tokio_boring::SslStreamBuilder 2023-12-14 16:05:09 +01:00
Anthony Ramine 9cf03ae4c1 Move async callbacks infra to boring itself
This helps drive async callbacks from outside tokio-boring, such as in quiche.

Not a breaking change because every public item in tokio-boring is preserved as is.
2023-11-27 11:53:35 +01:00
Anthony Ramine c38ed71511 Use replace_ex_data more
Setting callbacks multiple times on a SslContextBuilder causes the previous callback
installed to leak, using replace_ex_data internally prevents that.

We also start using it in tokio-boring in with_ex_data_future, my understanding
is that the futures currently in use are never installed twice by that function
but that could change in the future with the addition of more async callbacks.
2023-11-23 11:07:17 +01:00
Anthony Ramine a32783374f Properly drop overwritten ex data
We introduce new methods replace_ex_data for both SslContextBuilder
and Ssl in case anyone is relying on the leaking behaviour of their
set_ex_data methods, but we do document that they leak now.
2023-11-16 19:47:16 +01:00
Anthony Ramine 7c5fdfa0a8 Remove Sync trait bounds on callback futures
They are unnecessary as we ever only retrieve the futures from ex data
to poll them, thus when we have mutable access to them, so Send is all we need.
2023-11-03 13:31:11 +00:00
Anthony Ramine 1ca7f76607 Introduce set_async_get_session_callback 2023-10-25 10:25:55 +01:00
Anthony Ramine ea96015b66 Remove futures from ex data slots once they resolve 2023-10-10 09:22:36 +01:00
Anthony Ramine 907eaf079c Introduce async callbacks
We introduce tokio_boring::SslContextBuilderExt, with 2 methods:

* set_async_select_certificate_callback
* set_async_private_key_method
2023-10-10 09:22:36 +01:00
Anthony Ramine 1c790f7277 Introduce AsyncStreamBridge
This encapsulates a bit better the unsafety of task context
management to invoke async code from inside boring.
2023-10-10 09:22:36 +01:00
Anthony Ramine 3d7ff0a5c0 Introduce setup_accept and setup_connect
These two new kinds of methods immediately return a MidHandshakeSslStream
instead of actually initiating a handshake. This greatly simplifies
loops around MidHandshakeSslStream::WouldBlock.
2023-10-10 09:22:36 +01:00
Ivan Nikulin d1ee9bfd86 Use workspace metadata for crates 2023-07-10 11:38:18 +01:00
Oliver Gould c4e1f47497 Relax constraints on `Display for tokio-boring::HandshakeError`
`tokio_boring::HandshakeError` currently requires that the inner stream
implements `Debug` for its `Display` implementation. This constraint is
unnecessary.

This change removes this `Debug` constraint so `HandshakeError` always
implements `Display`.
2021-11-04 12:38:39 -05:00
Joshua Nelson 3a0e2db753 Update documentation for tokio-boring
This also adds an `examples/` directory, to make sure the example in the readme doesn't get out of
date.
2021-07-29 11:28:43 -04:00
Anthony Ramine 4473d08df4 Introduce HandshakeError::code 2021-04-16 12:48:20 +02:00
Anthony Ramine dd04ec0ef4 Provide access to inner I/O error during handshake 2021-04-06 10:04:46 +02:00
Anthony Ramine 8fc84f01e0 Add tokio_boring::HandshakeError::as_source_stream 2021-03-09 16:26:31 +01:00
Ivan Nikulin 10488a85f3 Sync upstream changes to support tokio 1.x
Bump major versions of hyper-boring and tokio-boring.
2021-02-18 16:12:19 +00:00
Ivan Nikulin f40ac2d1ed Implement conversion of HandshakeError to the source stream 2020-12-23 12:25:30 +00:00
Gabriela Alexandra Moldovan 31ed6443b1 Fix boring repository links. 2020-11-14 00:03:43 +00:00
Ivan Nikulin f4096d8afd Add hyper-boring 2020-11-11 20:29:54 +00:00
Ivan Nikulin 548771adb1 Add tokio-boring 2020-11-11 19:26:22 +00:00