Handling SSL_write() error