~singpolyma/xmpp-certwatch

3b8bde32e48cda81512cafd243fe43d9212492b0 — Stephen Paul Weber 5 months ago fd0032a
Error if no XMPP services found
1 files changed, 8 insertions(+), 0 deletions(-)

M common/common.go
M common/common.go => common/common.go +8 -0
@@ 194,12 194,14 @@ func CheckOne(hostname string) CheckResult {
			}
		}
	} else {
		anyService := false
		result, err := oneTarget(resolver, hostname, "_xmpp-client", hostname, false, 5222)
		if err != nil && err.Error() != "EOF" {
			finalResult.Err = err
			return finalResult
		}
		if err == nil {
			anyService = true
			finalResult.Dnssec = finalResult.Dnssec && result.dnssec
			finalResult.Daneok = finalResult.Daneok && result.daneok
			for ip, info := range result.tlsa {


@@ 213,12 215,18 @@ func CheckOne(hostname string) CheckResult {
			return finalResult
		}
		if err == nil {
			anyService = true
			finalResult.Dnssec = finalResult.Dnssec && result.dnssec
			finalResult.Daneok = finalResult.Daneok && result.daneok
			for ip, info := range result.tlsa {
				finalResult.Tlsa[ip] = info
			}
		}

		if !anyService {
			finalResult.Err = fmt.Errorf("No XMPP services found at %s", hostname)
			return finalResult
		}
	}

	for _, info := range finalResult.Tlsa {