]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
src/connection.c: Remove unnecessary check.
authorSimon Ruderich <simon@ruderich.org>
Tue, 22 Mar 2011 16:09:32 +0000 (17:09 +0100)
committerSimon Ruderich <simon@ruderich.org>
Tue, 22 Mar 2011 16:09:32 +0000 (17:09 +0100)
src/connection.c

index 09bfd0aa2739b982ff28acaba99735a96f8e8bdd..1d94d79654323dec4875aa4e7f9724f2d49208c5 100644 (file)
@@ -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,