1 | #include <Common/config.h> |
---|---|
2 | #if USE_SSL |
3 | #include "OpenSSLHelpers.h" |
4 | #include <ext/scope_guard.h> |
5 | #include <openssl/err.h> |
6 | |
7 | namespace DB |
8 | { |
9 | #pragma GCC diagnostic warning "-Wold-style-cast" |
10 | |
11 | String getOpenSSLErrors() |
12 | { |
13 | BIO * mem = BIO_new(BIO_s_mem()); |
14 | SCOPE_EXIT(BIO_free(mem)); |
15 | ERR_print_errors(mem); |
16 | char * buf = nullptr; |
17 | long size = BIO_get_mem_data(mem, &buf); |
18 | return String(buf, size); |
19 | } |
20 | |
21 | } |
22 | #endif |
23 |