From 28f6cc33be1ae9af34dcedc1f019f91f405de3ec Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 22 Mar 2011 17:09:32 +0100 Subject: [PATCH] src/connection.c: Remove unnecessary check. --- src/connection.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/connection.c b/src/connection.c index 09bfd0a..1d94d79 100644 --- a/src/connection.c +++ b/src/connection.c @@ -387,18 +387,17 @@ gnutls_certificate_allocate_credentials(): %s", result = gnutls_certificate_set_x509_trust_file(*x509_cred, PROXY_CA_FILE, GNUTLS_X509_FMT_PEM); + if (0 >= result) { + LOG(LOG_ERROR, + "initialize_tls_session_client(): can't read CA file: '%s'", + PROXY_CA_FILE); + gnutls_certificate_free_credentials(*x509_cred); + return -1; + } + } /* If the invalid hostname was specified do nothing, we use a self-signed * certificate in this case. */ - } else { - result = 1; - } - if (0 >= result) { - LOG(LOG_ERROR, - "initialize_tls_session_client(): can't read CA file: '%s'", - PROXY_CA_FILE); - gnutls_certificate_free_credentials(*x509_cred); - return -1; - } + /* And certificate for this website and proxy's private key. */ if (!use_invalid_cert) { result = gnutls_certificate_set_x509_key_file(*x509_cred, -- 2.45.2