uhttpd: - fix incorrect parsing of multiple listen options (#7458) - support PEM certificates for SSL
SVN-Revision: 21762
This commit is contained in:
parent
c80ad970e0
commit
585ffa4941
3 changed files with 14 additions and 3 deletions
|
@ -8,7 +8,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uhttpd
|
||||
PKG_RELEASE:=10
|
||||
PKG_RELEASE:=11
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -550,6 +550,7 @@ int main (int argc, char **argv)
|
|||
&hints, (opt == 's'), &conf
|
||||
);
|
||||
|
||||
memset(bind, 0, sizeof(bind));
|
||||
break;
|
||||
|
||||
#ifdef HAVE_TLS
|
||||
|
|
Loading…
Reference in a new issue