Skip to content

Remove all connect and accept functions - #142

Open
nox wants to merge 1 commit into
cloudflare:masterfrom
nox:revamp-handshake-entrypoints
Open

Remove all connect and accept functions#142
nox wants to merge 1 commit into
cloudflare:masterfrom
nox:revamp-handshake-entrypoints

Conversation

@nox

@noxnox commented Aug 3, 2023

Copy link
Copy Markdown
Contributor

Those functions were blurring the line between setup failures (which are caused by the developer misusing the API) and actual failures encountered on the stream while trying to achieve the TLS handshake, especially on SslConnector and SslAcceptor.

Removing them allows for the removal of HandshakeError, as the HandshakeError::SetupFailure variant becomes useless, and there is no real need to distinguish in that error type between Failure and WouldBlock when we can just check the error stored in MidHandshakeSslStream.

This then allow us to simplify tokio_boring's own entry points, also making them distinguish between setup failures and failures on the stream.

@nox
noxforce-pushed the revamp-handshake-entrypoints branch 7 times, most recently from 69081d5 to 5a93ea0CompareAugust 3, 2023 20:09
@noxnox mentioned this pull request Aug 4, 2023
@nox
noxforce-pushed the revamp-handshake-entrypoints branch from 5a93ea0 to 756f807CompareAugust 4, 2023 11:43
@nox
nox requested a review from inikulinAugust 4, 2023 14:01
@nox
noxforce-pushed the revamp-handshake-entrypoints branch from 756f807 to 7942e71CompareAugust 4, 2023 15:27
@ghedoghedo added the v5 label Sep 26, 2025
@kornelskikornelski removed the v5 label Nov 4, 2025
@nox
noxforce-pushed the revamp-handshake-entrypoints branch from 7942e71 to 5f74ec0CompareNovember 19, 2025 16:44
Those functions were blurring the line between setup failures
(which are caused by the developer misusing the API) and actual
failures encountered on the stream while trying to achieve the
TLS handshake, especially on SslConnector and SslAcceptor.
Removing them allows for the removal of HandshakeError, as
the HandshakeError::SetupFailure variant becomes useless,
and there is no real need to distinguish in that error type
between Failure and WouldBlock when we can just check
the error stored in MidHandshakeSslStream.
This then allow us to simplify tokio_boring's own entry points,
also making them distinguish between setup failures and failures
on the stream.
@nox
noxforce-pushed the revamp-handshake-entrypoints branch from 5f74ec0 to 655c6feCompareNovember 20, 2025 09:40
@noxnox changed the title Revamp handshake entrypointsRemove all connect and accept functionsNov 20, 2025
@nox

nox commented Nov 20, 2025

Copy link
Copy Markdown
ContributorAuthor

I've changed the PR to be about removing every entry point that returned HandshakeError along with the enum itself, as setup_accept and setup_connect were already merged as part of #134.

@noxnox added the v5 label Nov 25, 2025
@kornelskikornelski removed the v5 label Jan 20, 2026
@kornelski

Copy link
Copy Markdown
Collaborator

Let's leave it for v6. Getting boring-sys v5 out ASAP is important.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@nox@kornelski@ghedo