mirror of
https://github.com/vlang/v.git
synced 2025-09-16 07:52:32 +03:00
net.openssl, net.mbedtls: add support for -d trace_ssl
, for easier tracing of binary protocol problems to https servers
This commit is contained in:
parent
7f3531077d
commit
bfb47005c8
4 changed files with 136 additions and 15 deletions
|
@ -3,6 +3,9 @@ module openssl
|
|||
// ssl_error returns non error ssl code or error if unrecoverable and we should panic
|
||||
fn ssl_error(ret int, ssl voidptr) !SSLError {
|
||||
res := C.SSL_get_error(ssl, ret)
|
||||
$if trace_ssl ? {
|
||||
eprintln('${@METHOD} ret: ${ret} | ssl: ${ssl:x} | res: ${res}')
|
||||
}
|
||||
match unsafe { SSLError(res) } {
|
||||
.ssl_error_syscall {
|
||||
return error_with_code('unrecoverable syscall (${res})', res)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue