Browse Source

handle eof on handshake

ncannasse 6 years ago
parent
commit
2619e01131
1 changed files with 2 additions and 0 deletions
  1. 2 0
      libs/ssl/ssl.c

+ 2 - 0
libs/ssl/ssl.c

@@ -110,6 +110,8 @@ HL_PRIM int HL_NAME(ssl_handshake)(mbedtls_ssl_context *ssl) {
 	r = mbedtls_ssl_handshake(ssl);
 	if( is_ssl_blocking(r) )
 		return -1;
+	if( r == MBEDTLS_ERR_SSL_CONN_EOF )
+		return -2;
 	if( r != 0 )
 		return ssl_error(r);
 	return 0;