asyncnet, net: call SSL_shutdown only when connection established

This commit prevents "SSL_shutdown while in init" errors from happening.

See https://github.com/openssl/openssl/issues/710#issuecomment-253897666
This commit is contained in:
Leorize 2020-06-01 17:10:02 -05:00 • committed by Andreas Rumpf
commit 82092b3bb7
4 changed files with 52 additions and 12 deletions

View file

@ -124,7 +124,8 @@ when not defined(windows):
let msg = getCurrentExceptionMsg()
log "client: exception: " & msg
# SSL_shutdown:shutdown while in init
if not (msg.contains("shutdown while in init") or msg.contains("alert number 48") or
msg.contains("routines:CONNECT_CR_CERT:certificate verify failed")):
if not (msg.contains("alert number 48") or
msg.contains("routines:CONNECT_CR_CERT:certificate verify failed") or
msg.contains("routines:tls_process_server_certificate:certificate verify failed")):
echo "CVerifyPeer exception: " & msg
check(false)