Avoid using ERR_put_error() directly in OpenSSL code