From b2037c3f962677460f93e53388dd0de1a93c2006 Mon Sep 17 00:00:00 2001 From: Nick Peng Date: Fri, 10 Mar 2023 23:43:42 +0800 Subject: [PATCH] dns_server: fix bind-tls fail when cert file exists --- etc/smartdns/smartdns.conf | 6 +----- src/smartdns.c | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/etc/smartdns/smartdns.conf b/etc/smartdns/smartdns.conf index 6c529f2..f8b2e6c 100644 --- a/etc/smartdns/smartdns.conf +++ b/etc/smartdns/smartdns.conf @@ -50,11 +50,7 @@ # bind [::]:53 # bind [::]:53@eth0 # bind-tcp [::]:53 -bind [::]:7053 - -server 192.168.1.1:6053 -bootstrap-dns -server dns.google -server 192.168.1.1:6053 +bind-tls [::]:53 # tcp connection idle timeout # tcp-idle-time [second] diff --git a/src/smartdns.c b/src/smartdns.c index f4a80be..c6356e7 100644 --- a/src/smartdns.c +++ b/src/smartdns.c @@ -371,7 +371,7 @@ static int _smartdns_create_cert(void) } if (dns_conf_bind_ca_file[0] != 0 && dns_conf_bind_ca_key_file[0] != 0) { - return -1; + return 0; } conf_get_conf_fullpath("smartdns-cert.pem", dns_conf_bind_ca_file, sizeof(dns_conf_bind_ca_file));