Fixed the logging of OpenSSL errors to report the correct details for the current OpenSSL error