run SSL_shutdown in a loop