From: Simon Ruderich Date: Tue, 22 Mar 2011 16:09:32 +0000 (+0100) Subject: src/connection.c: Remove unnecessary check. X-Git-Tag: 0.2~3 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=28f6cc33be1ae9af34dcedc1f019f91f405de3ec;p=tlsproxy%2Ftlsproxy.git src/connection.c: Remove unnecessary check. --- 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,