TLS shutdown, order of operations