aboutsummaryrefslogtreecommitdiff
path: root/lib/ssluse.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-05-21 08:15:42 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-05-21 08:15:42 +0000
commit323f19503630808c3085a80b53e2b23bf934efc3 (patch)
tree4396f5e8df0a61873cec18a882bec906cf73c9a2 /lib/ssluse.c
parentc3c392fc9801e7eb1834613ad41c57bb386355c0 (diff)
ASN1 files don't work for the *chain_file(), make them use the previous
version
Diffstat (limited to 'lib/ssluse.c')
-rw-r--r--lib/ssluse.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/ssluse.c b/lib/ssluse.c
index e1a6b3b5d..7a4d685a5 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -227,13 +227,25 @@ int cert_stuff(struct connectdata *conn,
switch(file_type) {
case SSL_FILETYPE_PEM:
- case SSL_FILETYPE_ASN1:
+ /* SSL_CTX_use_certificate_chain_file() only works on PEM files */
if (SSL_CTX_use_certificate_chain_file(conn->ssl.ctx,
cert_file) != 1) {
failf(data, "unable to set certificate file (wrong password?)");
return 0;
}
break;
+
+ case SSL_FILETYPE_ASN1:
+ /* SSL_CTX_use_certificate_file() works with either PEM or ASN1, but
+ we use the case above for PEM so this can only be performed with
+ ASN1 files. */
+ if (SSL_CTX_use_certificate_file(conn->ssl.ctx,
+ cert_file,
+ file_type) != 1) {
+ failf(data, "unable to set certificate file (wrong password?)");
+ return 0;
+ }
+ break;
case SSL_FILETYPE_ENGINE:
failf(data, "file type ENG for certificate not implemented");
return 0;