diff --git a/va/va.go b/va/va.go index dfc173319..7a7981945 100644 --- a/va/va.go +++ b/va/va.go @@ -868,7 +868,7 @@ func (va *ValidationAuthorityImpl) PerformValidation(ctx context.Context, domain logEvent := verificationRequestEvent{ ID: authz.ID, Requester: authz.RegistrationID, - Hostname: authz.Identifier.Value, + Hostname: domain, RequestTime: va.clk.Now(), } vStart := va.clk.Now() diff --git a/va/va_test.go b/va/va_test.go index be229fb63..67f5b7ae9 100644 --- a/va/va_test.go +++ b/va/va_test.go @@ -824,7 +824,7 @@ func TestDNSValidationEmpty(t *testing.T) { } func TestPerformValidationValid(t *testing.T) { - va, _ := setup(nil, 0) + va, mockLog := setup(nil, 0) // create a challenge with well known token chalDNS := core.DNSChallenge01() @@ -840,6 +840,13 @@ func TestPerformValidationValid(t *testing.T) { if samples != 1 { t.Errorf("Wrong number of samples for successful validation. Expected 1, got %d", samples) } + resultLog := mockLog.GetAllMatching(`Validation result`) + if len(resultLog) != 1 { + t.Fatalf("Wrong number of matching lines for 'Validation result'") + } + if !strings.Contains(resultLog[0], `"Hostname":"good-dns01.com"`) { + t.Errorf("PerformValidation didn't log validation hostname.") + } } func TestDNSValidationFailure(t *testing.T) {