diff options
author | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2018-09-24 13:13:35 +0000 |
---|---|---|
committer | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2018-09-24 13:13:35 +0000 |
commit | 5b20f717d71b4813ea1c2af0c88a9bac3b92dd87 (patch) | |
tree | 81f19abcdfe6754d2041ed1e8a3a83b62d974b7e | |
parent | 17a03374bf75ec1c55def814c582fba9b2097eb0 (diff) | |
download | neon-5b20f717d71b4813ea1c2af0c88a9bac3b92dd87.tar.gz |
* src/ne_socket.c (ne_sock_close): Complete a bidirectional shutdown
for OpenSSL.
git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@2022 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
-rw-r--r-- | src/ne_socket.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ne_socket.c b/src/ne_socket.c index 879880e..406ed0b 100644 --- a/src/ne_socket.c +++ b/src/ne_socket.c @@ -1923,12 +1923,13 @@ int ne_sock_close(ne_socket *sock) { int ret; - /* Per API description - for an SSL connection, simply send the - * close_notify but do not wait for the peer's response. */ + /* Complete a bidirectional shutdown for SSL/TLS. */ #if defined(HAVE_OPENSSL) if (sock->ssl) { - SSL_shutdown(sock->ssl); - SSL_free(sock->ssl); + if (SSL_shutdown(sock->ssl) == 0) { + SSL_shutdown(sock->ssl); + } + SSL_free(sock->ssl); } #elif defined(HAVE_GNUTLS) if (sock->ssl) { |