MINOR: quic: Add a function to dump SSL stack errors
This has been very helpful to fix SSL related issues.
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index d7cef76..750e4d0 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -1562,6 +1562,26 @@
return 0;
}
+/* This function gives the detail of the SSL error. It is used only
+ * if the debug mode and the verbose mode are activated. It dump all
+ * the SSL error until the stack was empty.
+ */
+static forceinline void qc_ssl_dump_errors(struct connection *conn)
+{
+ if (unlikely(global.mode & MODE_DEBUG)) {
+ while (1) {
+ unsigned long ret;
+
+ ret = ERR_get_error();
+ if (!ret)
+ return;
+
+ fprintf(stderr, "conn. @%p OpenSSL error[0x%lx] %s: %s\n", conn, ret,
+ ERR_func_error_string(ret), ERR_reason_error_string(ret));
+ }
+ }
+}
+
/* Provide CRYPTO data to the TLS stack found at <data> with <len> as length
* from <qel> encryption level with <ctx> as QUIC connection context.
* Remaining parameter are there for debugging purposes.