From 9f35767f1009078483deedd4e100b83bdaa47f47 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Sat, 10 Feb 2024 20:32:03 -0500 Subject: [PATCH] Don't crash if there is no cert chain --- common/common.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/common.go b/common/common.go index 5c71ab8..adc81c2 100644 --- a/common/common.go +++ b/common/common.go @@ -94,6 +94,9 @@ func oneTarget(resolver *dane.Resolver, service string, selector string, target } cs := conn.ConnectionState() + if len(cs.PeerCertificates) < 1 { + return TargetResult{}, fmt.Errorf("No certificate given for %s", target) + } sha256, _ := dns.CertificateToDANE(1, 1, cs.PeerCertificates[0]) daneok = daneok && config.Okdane -- 2.45.2