Proper SSL shutdown handling.
If connection has unsent alerts, SSL_shutdown() tries to send them even
if SSL_set_shutdown(SSL_RECEIVED_SHUTDOWN|SSL_SENT_SHUTDOWN) was used.
This can be prevented by SSL_set_quiet_shutdown(). SSL_set_shutdown()
is required nevertheless to preserve session.
Maxim Dounin
10 years ago
1204 | 1204 | |
1205 | 1205 | if (c->timedout) { |
1206 | 1206 | mode = SSL_RECEIVED_SHUTDOWN|SSL_SENT_SHUTDOWN; |
1207 | SSL_set_quiet_shutdown(c->ssl->connection, 1); | |
1207 | 1208 | |
1208 | 1209 | } else { |
1209 | 1210 | mode = SSL_get_shutdown(c->ssl->connection); |
1214 | 1215 | |
1215 | 1216 | if (c->ssl->no_send_shutdown) { |
1216 | 1217 | mode |= SSL_SENT_SHUTDOWN; |
1218 | } | |
1219 | ||
1220 | if (c->ssl->no_wait_shutdown && c->ssl->no_send_shutdown) { | |
1221 | SSL_set_quiet_shutdown(c->ssl->connection, 1); | |
1217 | 1222 | } |
1218 | 1223 | } |
1219 | 1224 |