From 181ee44a517e29956d95283ea023c7ba363022d6 Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Tue, 26 Jun 2018 13:40:53 +0200 Subject: [PATCH] fix --- httpd.c | 6 ++++-- libs/handle.c | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/httpd.c b/httpd.c index 955d364..0085631 100644 --- a/httpd.c +++ b/httpd.c @@ -52,8 +52,10 @@ void configure_context(SSL_CTX *ctx) SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_TICKET); SSL_CTX_set_session_id_context(ctx, (void *)&ssl_session_ctx_id, sizeof(ssl_session_ctx_id)); /* Set the key and cert */ - if (SSL_CTX_use_certificate_file(ctx, server_config.sslcert, SSL_FILETYPE_PEM) <= 0) { - ERR_print_errors_fp(stderr); + /* use the full chain bundle of certificate */ + //if (SSL_CTX_use_certificate_file(ctx, server_config.sslcert, SSL_FILETYPE_PEM) <= 0) { + if (SSL_CTX_use_certificate_chain_file(ctx, server_config.sslcert) <= 0) { + ERR_print_errors_fp(stderr); exit(EXIT_FAILURE); } diff --git a/libs/handle.c b/libs/handle.c index effefb3..a5d1657 100644 --- a/libs/handle.c +++ b/libs/handle.c @@ -87,10 +87,10 @@ int antd_send(void *src, const void* data, int len) #ifdef USE_OPENSSL } #endif - if(ret <= 0) + /*if(ret <= 0) { antd_close(src); - } + }*/ return ret; } int antd_recv(void *src, void* data, int len) @@ -111,10 +111,10 @@ int antd_recv(void *src, void* data, int len) #ifdef USE_OPENSSL } #endif - if(ret == 0) + /*if(ret == 0) { antd_close(src); - } + }*/ return ret; } int antd_close(void* src) @@ -136,6 +136,7 @@ int antd_close(void* src) server_config.connection--; LOG("Remaining connection %d\n", server_config.connection); free(src); + src = NULL; return ret; } int __ti(void* client,int data)