~singpolyma/xmpp-certwatch

9f35767f1009078483deedd4e100b83bdaa47f47 — Stephen Paul Weber 7 months ago 52b05d9
Don't crash if there is no cert chain
1 files changed, 3 insertions(+), 0 deletions(-)

M common/common.go
M common/common.go => common/common.go +3 -0
@@ 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