-
Notifications
You must be signed in to change notification settings - Fork 48
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
Error functions #119
Error functions #119
Conversation
Co-authored-by: Antonio Nuno Monteiro <[email protected]>
Co-authored-by: Antonio Nuno Monteiro <[email protected]>
val get_error_string : unit -> string | ||
[@@ocaml.alert deprecated "Use [Ssl.Error.get_error] instead"] | ||
|
||
module Error: sig |
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.
@Firgeis In a follow-up PR, it'd be nice to explain in this doc that OpenSSL keeps an error queue per thread, that it gets cleaned up before every TLS operation, which can then lead to users of ocaml-ssl understanding what it means to get vs peek errors.
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.
@anmonteiro When you say in this doc, you mean as a comment for the error module?
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.
yeah, in this .mli
file.
Thank you |
CHANGES: - Raise an error when `Ssl.flush` isn't successful (savonet/ocaml-ssl#104, savonet/ocaml-ssl#120) - Add an API-compatible `Ssl.Runtime_lock` module. The functions in this module don't release the OCaml runtime lock. While they don't allow other OCaml threads to run concurrently, they don't perform any copying in the underlying data, leading certain workloads to be faster than their counterparts that release the lock. (savonet/ocaml-ssl#106) - Guarantee `Ssl.output_string` writes the whole string by retrying the operation with unwritten bytes (savonet/ocaml-ssl#103, savonet/ocaml-ssl#116) - Fix calls in C stubs that need to call `ERR_clear_error` before the underlying OpenSSL call (savonet/ocaml-ssl#118) - Add a module `Ssl.Error` to retrieve OpenSSL errors in a structured way (savonet/ocaml-ssl#119) - Deprecate Ssl.{SSLv23,SSLv3,TLSv1,TLSv1_1}, which were were formally deprecated in March 2021 and earlier (savonet/ocaml-ssl#115).
CHANGES: - Raise an error when `Ssl.flush` isn't successful (savonet/ocaml-ssl#104, savonet/ocaml-ssl#120) - Add an API-compatible `Ssl.Runtime_lock` module. The functions in this module don't release the OCaml runtime lock. While they don't allow other OCaml threads to run concurrently, they don't perform any copying in the underlying data, leading certain workloads to be faster than their counterparts that release the lock. (savonet/ocaml-ssl#106) - Guarantee `Ssl.output_string` writes the whole string by retrying the operation with unwritten bytes (savonet/ocaml-ssl#103, savonet/ocaml-ssl#116) - Fix calls in C stubs that need to call `ERR_clear_error` before the underlying OpenSSL call (savonet/ocaml-ssl#118) - Add a module `Ssl.Error` to retrieve OpenSSL errors in a structured way (savonet/ocaml-ssl#119) - Deprecate Ssl.{SSLv23,SSLv3,TLSv1,TLSv1_1}, which were were formally deprecated in March 2021 and earlier (savonet/ocaml-ssl#115).
This PR should solve #108
For compatibility I have reproduced the behavior of the function used to print exceptions with the ERR_error_string_n but with the functionality of the ERR_peek_last_error function (peeks the last error)