From: Gert van Dijk Date: Sun, 27 Aug 2017 16:15:15 +0000 (+0200) Subject: Warn that DH config option is only meaningful in a tls-server context X-Git-Tag: v2.4.4~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1298bbb2be73e978bb5b555d1bd8722cf9b28b0;p=thirdparty%2Fopenvpn.git Warn that DH config option is only meaningful in a tls-server context If specified in a tls-client context, don't try to open the file as it's not used. Worse even, if 'none' was specified to disable explicitly, it complained that the file 'none' could not be found. [DS: On-the-fly update - Prefixed the message with 'WARNING: '] Signed-off-by: Gert van Dijk Acked-by: Steffan Karger Acked-by: David Sommerseth Message-Id: <20170827161515.2424-1-gert@gertvandijk.net> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15332.html Signed-off-by: David Sommerseth (cherry picked from commit 47a0a80b7718fe88451c82bdfe838e5a6e3c4248) --- diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 79429d528..8dee5d13d 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3027,6 +3027,13 @@ options_postprocess_mutate(struct options *o) o->dh_file = NULL; } } + else if (o->dh_file) + { + /* DH file is only meaningful in a tls-server context. */ + msg(M_WARN, "WARNING: Ignoring option 'dh' in tls-client mode, please only " + "include this in your server configuration"); + o->dh_file = NULL; + } /* cipher negotiation (NCP) currently assumes --pull or --mode server */ if (o->ncp_enabled