-
Notifications
You must be signed in to change notification settings - Fork 153
Expose ssl_select_cert_disable_ech #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,9 +96,16 @@ impl SslContextBuilder { | |
| Poll::Pending => return Err(SelectCertError::RETRY), | ||
| }; | ||
|
|
||
| let finish = fut_result.or(Err(SelectCertError::ERROR))?; | ||
|
|
||
| finish(client_hello).or(Err(SelectCertError::ERROR)) | ||
| let finish = fut_result.map_err(|e| match e { | ||
| AsyncSelectCertError::Error => SelectCertError::ERROR, | ||
| AsyncSelectCertError::DisableEch => SelectCertError::DISABLE_ECH, | ||
| })?; | ||
|
|
||
| match finish(client_hello) { | ||
| Ok(_) => Ok(()), | ||
| Err(AsyncSelectCertError::Error) => Err(SelectCertError::ERROR), | ||
| Err(AsyncSelectCertError::DisableEch) => Err(SelectCertError::DISABLE_ECH), | ||
| } | ||
| }); | ||
| } | ||
|
|
||
|
|
@@ -230,7 +237,12 @@ where | |
|
|
||
| /// A fatal error to be returned from async select certificate callbacks. | ||
| #[derive(Debug, Copy, Clone, PartialEq, Eq)] | ||
| pub struct AsyncSelectCertError; | ||
| pub enum AsyncSelectCertError { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't really an "error" anymore, and since we are changing the type anyway we might as well rename it as well. Maybe "AsyncSelectCertResult" or "AsyncSelectCertAction" or something along those lines.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could also maybe make this enum |
||
| /// A fatal error occurred and the handshake should be terminated. | ||
| Error, | ||
| /// Discard ECH ClientHelloInner and re-handshake with ClientHelloOuter. | ||
| DisableEch, | ||
| } | ||
|
|
||
| /// Describes async private key hooks. This is used to off-load signing | ||
| /// operations to a custom, potentially asynchronous, backend. Metadata about the | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs to be updated to reflect the fact that it's not really a fatal error anymore.