diff --git a/ngx_rtmp_init.c b/ngx_rtmp_init.c index 3f54169..459406d 100644 --- a/ngx_rtmp_init.c +++ b/ngx_rtmp_init.c @@ -258,6 +258,17 @@ ngx_rtmp_close_connection(ngx_connection_t *c) ngx_log_debug0(NGX_LOG_DEBUG_RTMP, c->log, 0, "close connection"); +#if (NGX_SSL) + + if (c->ssl) { + if (ngx_ssl_shutdown(c) == NGX_AGAIN) { + c->ssl->handler = ngx_rtmp_close_connection; + return; + } + } + +#endif + #if (NGX_STAT_STUB) (void) ngx_atomic_fetch_add(ngx_stat_active, -1); #endif