Error management in ssl calls