diff options
author | dkatz@damien-katzs-computer.local <> | 2007-07-12 22:06:33 -0400 |
---|---|---|
committer | dkatz@damien-katzs-computer.local <> | 2007-07-12 22:06:33 -0400 |
commit | 899aaa6bb2a684b366ec462c8e7160897fde4299 (patch) | |
tree | d6585a05edfef5208ae906f073d0280bb05f4679 /vio | |
parent | b36295dd177fea39a9d5cbad69c3b8b61d30e946 (diff) | |
download | mariadb-git-899aaa6bb2a684b366ec462c8e7160897fde4299.tar.gz |
Bug #29579 Clients using SSL can hang the server
Added an option to yassl to allow "quiet shutdown" like openssl does. This option causes the SSL libs to NOT perform the close_notify handshake during shutdown. This fixes a hang we experience because we hold a lock during socket shutdown.
Diffstat (limited to 'vio')
-rw-r--r-- | vio/viossl.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vio/viossl.c b/vio/viossl.c index 5e4203a3fb5..861989136d3 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -123,6 +123,16 @@ int vio_ssl_close(Vio *vio) if (ssl) { + /* + THE SSL standard says that SSL sockets must send and receive a close_notify + alert on socket shutdown to avoid truncation attacks. However, this can + cause problems since we often hold a lock during shutdown and this IO can + take an unbounded amount of time to complete. Since our packets are self + describing with length, we aren't vunerable to these attacks. Therefore, + we just shutdown by closing the socket (quiet shutdown). + */ + SSL_set_quiet_shutdown(ssl, 1); + switch ((r= SSL_shutdown(ssl))) { case 1: |