MINOR: ssl: improve the errors when a crt can't be open
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 7 Apr 2020 12:16:32 +0000 (14:16 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 7 Apr 2020 12:29:01 +0000 (14:29 +0200)
commit18ba293b7e57c51025b9bafff82fb29287e85523
tree0469fd2808e9930011e0baf0afc1057b4cbe122c
parentc7a203a6c75e4efff5f3d5d675d925f11b47dba1
MINOR: ssl: improve the errors when a crt can't be open

Issue #574 reported an unclear error when trying to open a file with not
enough permission.

  [ALERT] 096/032117 (835) : parsing [/etc/haproxy/haproxy.cfg:54] : 'bind :443' : error encountered while processing 'crt'.
  [ALERT] 096/032117 (835) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
  [ALERT] 096/032117 (835) : Fatal errors found in configuration.

Improve the error to give us more information:

  [ALERT] 097/142030 (240089) : parsing [test.cfg:22] : 'bind :443' : cannot open the file 'kikyo.pem.rsa'.
  [ALERT] 097/142030 (240089) : Error(s) found in configuration file : test.cfg
  [ALERT] 097/142030 (240089) : Fatal errors found in configuration.

This patch could be backported in 2.1.

(cherry picked from commit 7fd01b36257ffa9fe76930ccfe8a34ad40911fef)
Signed-off-by: William Lallemand <wlallemand@haproxy.org>
src/ssl_sock.c