diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-06-12 12:58:11 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-06-12 12:58:11 +0000 |
commit | 120a23987a3b6152d4688200e23cc98e85b5a261 (patch) | |
tree | f87f722897d00068f2d1ef3e9904629fca155366 /package/uhttpd/src/uhttpd-tls.c | |
parent | 5c835e4d31216d7dd5f0d090f726ee33fc27c8d3 (diff) |
[package] uhttpd:
- fix incorrect parsing of multiple listen options (#7458)
- support PEM certificates for SSL
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21762 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/uhttpd/src/uhttpd-tls.c')
-rw-r--r-- | package/uhttpd/src/uhttpd-tls.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/package/uhttpd/src/uhttpd-tls.c b/package/uhttpd/src/uhttpd-tls.c index cb50616380..26143ddf71 100644 --- a/package/uhttpd/src/uhttpd-tls.c +++ b/package/uhttpd/src/uhttpd-tls.c @@ -35,12 +35,22 @@ SSL_CTX * uh_tls_ctx_init() int uh_tls_ctx_cert(SSL_CTX *c, const char *file) { - return SSL_CTX_use_certificate_file(c, file, SSL_FILETYPE_ASN1); + int rv; + + if( (rv = SSL_CTX_use_certificate_file(c, file, SSL_FILETYPE_PEM)) < 1 ) + rv = SSL_CTX_use_certificate_file(c, file, SSL_FILETYPE_ASN1); + + return rv; } int uh_tls_ctx_key(SSL_CTX *c, const char *file) { - return SSL_CTX_use_PrivateKey_file(c, file, SSL_FILETYPE_ASN1); + int rv; + + if( (rv = SSL_CTX_use_PrivateKey_file(c, file, SSL_FILETYPE_PEM)) < 1 ) + rv = SSL_CTX_use_PrivateKey_file(c, file, SSL_FILETYPE_ASN1); + + return rv; } void uh_tls_ctx_free(struct listener *l) |