Skip to content

Override hostname with server configuration in SecureSocket

Hi,

This merge request override the hostname used in the SecureSocket watcher with the value of the key hostname in servers.

This allow to have each server define its own hostname (as a sring, but could be a list)

[srv1]
name = "SRV1"
ipv4 = "10.0.0.1"
hostname = "srv1.fqdn.tld"

[srv2]
name = "SRV2"
ipv4 = "10.0.0.2"
hostname = "srv2.fqdn.tld"

This allow to create a group with these two server and use it in the watcher without repeating the SecureSocket watcher in watchers.toml

# groups.toml
check_ssl_hostnames = ["srv1", "srv2"]
# watchers.toml
[check_ssl]
description = "SSL cert matches hostname"
service = "network.SecuredSocket"
group = "check_ssl_hostnames"

I didn't implemented any unittest but will gladly do it if you considere merging this MR.

Merge request reports