aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gtls.c7
-rw-r--r--lib/ssluse.c2
-rw-r--r--lib/strerror.c3
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/gtls.c b/lib/gtls.c
index b202adfd4..02680d02b 100644
--- a/lib/gtls.c
+++ b/lib/gtls.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -234,9 +234,12 @@ Curl_gtls_connect(struct connectdata *conn,
rc = gnutls_certificate_set_x509_trust_file(conn->ssl[sockindex].cred,
data->set.ssl.CAfile,
GNUTLS_X509_FMT_PEM);
- if(rc < 0)
+ if(rc < 0) {
infof(data, "error reading ca cert file %s (%s)\n",
data->set.ssl.CAfile, gnutls_strerror(rc));
+ if (data->set.ssl.verifypeer)
+ return CURLE_SSL_CACERT_BADFILE;
+ }
else
infof(data, "found %d certificates in %s\n",
rc, data->set.ssl.CAfile);
diff --git a/lib/ssluse.c b/lib/ssluse.c
index 2d6a6fed6..28c2ef62b 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -1272,7 +1272,7 @@ Curl_ossl_connect_step1(struct connectdata *conn,
" CAfile: %s\n CApath: %s\n",
data->set.ssl.CAfile ? data->set.ssl.CAfile : "none",
data->set.ssl.CApath ? data->set.ssl.CApath : "none");
- return CURLE_SSL_CACERT;
+ return CURLE_SSL_CACERT_BADFILE;
}
else {
/* Just continue with a warning if no strict certificate verification
diff --git a/lib/strerror.c b/lib/strerror.c
index 62ccfe9a0..3e466c688 100644
--- a/lib/strerror.c
+++ b/lib/strerror.c
@@ -227,6 +227,9 @@ curl_easy_strerror(CURLcode error)
return "couldn't use specified SSL cipher";
case CURLE_SSL_CACERT:
+ return "peer certificate cannot be authenticated with known CA certificates";
+
+ case CURLE_SSL_CACERT_BADFILE:
return "problem with the SSL CA cert (path? access rights?)";
case CURLE_BAD_CONTENT_ENCODING: