Commit Graph

16 Commits

Author SHA1 Message Date
Kornel a91bfdc67d Error descriptions and docs 2025-09-03 17:24:30 +01: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
Leo Blöcher baede6c0af Remove INVALID_CALL from mid-handshake error message
Mid-handshake errors that occur before certificate verification
currently look like this:

```
TLS handshake failed: cert verification failed - Invalid certificate verification context [WRONG_VERSION_NUMBER]
```

Despite no certificate even being received yet, the error complains
about a failed verification. The cause here is that `cert verification
failed` is only omitted if the verification result is `OK`. The default
in BoringSSL before verification runs is `INVALID_CALL`, however.

`INVALID_CALL` is set/returned in these places:
- 44b3df6f03/src/ssl/internal.h (L3904)
- 44b3df6f03/src/ssl/ssl_session.cc (L396)
- 44b3df6f03/src/ssl/ssl_x509.cc (L713)

It is not used anywhere else as a verification result code. To improve
the error message, this commit adds `INVALID_CALL` as a verification
result for which no additional error is dislayed.
2025-01-06 16:12:05 +00:00
Evan Rittenhouse 0f5731b1d8 Expose SSL_get_error 2024-01-09 16:42:58 +01:00
Anthony Ramine 72f4bf5724 Introduce set_custom_verify_callback and set_async_custom_verify_callback 2023-12-14 16:31:09 +01:00
Anthony Ramine 84a80c1916 Change X509VerifyResult to Result<(), X509VerifyError>
This commit separates X509VerifyResult::OK from the rest
of the codes that actually represent errors, using
a Result type as usual.
2023-10-11 14:42:59 +02:00
Alessandro Ghedini 97e2a8bc30 Add a few WouldBlock cases 2023-10-10 09:22:36 +01:00
Alessandro Ghedini 7b0de9341c Introduce ssl::Error::would_block 2023-10-10 09:22:36 +01:00
Ivan Nikulin bb063aa9e6 Fix Diplay panics for HandshakeError with `rpk` (fixes #140) 2023-08-03 15:00:09 +01:00
Joshua Nelson 46787b7b69 Run `cargo fix --edition 2021-08-13 15:22:56 -05:00
Anthony Ramine 4353e4f8f3 Use Display for ssl::Error in Display for ssl::HandshakeError 2021-03-15 13:32:23 +01:00
Anthony Ramine 56564c7cb6 Tweak yet again the boring error reporting
We also omit file and line in ErrorStack itself now too.

ErrorStack is the wrapped error type returned by
hyper_boring::HttpsConnector::call.
2021-03-15 11:26:09 +01:00
Anthony Ramine 6f4ecb3d90 Remove file/line from Display for HandshakeError 2021-03-11 14:42:00 +01:00
Anthony Ramine 51734088ef Print handshake errors in a better way
We completely ignore the ErrorStack value if it is
an X509 verification failure.
2021-03-09 16:26:30 +01:00
Ivan Nikulin 5cb8947d7e Rename stuff 2020-11-11 17:47:30 +00:00