| index 7eef19508..03de19a88 100644 |
| --- a/internal/edge/certsync_e2e_test.go |
| +++ b/internal/edge/certsync_e2e_test.go |
| @@ -1163,13 +1163,19 @@ func TestCertSyncE2EConcurrentRefreshIsRaceFree(t *testing.T) { |
| // every host in its own route table). |
| const e2eRemoteHomedHost = "remote.bab.example.test" |
| |
| -// The automated shadow of the dev proof that failed as #277: a member points |
| -// a custom domain's A record at edge B, which homes nothing for that name. B |
| -// backhauls to A, A (the issuer) sees the hello and orders, and the CA then |
| -// validates against B — the box whose registry has never heard of the host. |
| -// Before the widening, B refused the challenge, every authorization failed, |
| -// and the name's Let's Encrypt budget went in minutes. After it, B answers |
| -// out of the bucket, A mints, and the certificate reaches B's mirror. |
| +// The automated shadow of the dev proof that failed as #277: DNS for an |
| +// exactly-named registry ROUTE points at edge B, which homes nothing for that |
| +// name. B backhauls to A, A (the issuer) sees the hello and orders, and the CA |
| +// then validates against B — the box whose registry has never heard of the |
| +// host. Before the widening, B refused the challenge, every authorization |
| +// failed, and the name's Let's Encrypt budget went in minutes. After it, B |
| +// answers out of the bucket, A mints, and the certificate reaches B's mirror. |
| +// |
| +// A route, deliberately, and not an attached custom domain: an alias attach |
| +// lands in route_aliases (internal/domains/aliases.go), which edgesFilePass |
| +// never publishes — so no alias is in any home map, on any box. The spec |
| +// amendment records that as an open follow-up rather than a claim this test |
| +// could make. |
| // |
| // The backhaul leg itself is not re-proved here (homemap_test.go owns it); |
| // what this pins is that everything CERT-side works with the host in ONE |
| @@ -1249,13 +1255,24 @@ func TestNonHomeEdgeAnswersValidationForRemoteHomedHost(t *testing.T) { |
| // Written through a THIRD handle on the bucket, standing in for the |
| // issuer's publishingCache: edge B's own handle must stay write-free, |
| // which the last subtest asserts. |
| - putBucket(t, release.NewDirStore(bucket), e2eRemoteHomedHost+alpnTokenSuffix, |
| + issuerHandle := release.NewDirStore(bucket) |
| + putBucket(t, issuerHandle, e2eRemoteHomedHost+alpnTokenSuffix, |
| hostCertPEM(t, e2eRemoteHomedHost, time.Now().Add(24*time.Hour))) |
| if c := edgeB.mirror.alpnTokenCert(context.Background(), e2eRemoteHomedHost); c == nil { |
| t.Fatal("edge B refused a tls-alpn-01 validation for a host edge A homes") |
| } |
| // And the label under the mirrored catch-all is still refused (#180). |
| - if c := edgeB.mirror.alpnTokenCert(context.Background(), "invented.other.example.test"); c != nil { |
| + // The token cert for it is PUT FIRST and the label is asserted |
| + // dialable: without both, a nil answer here would prove only that the |
| + // bucket is empty, and the refusal would pass even if KnownHost leaked |
| + // through Home()'s one-label rule. |
| + const invented = "invented.other.example.test" |
| + putBucket(t, issuerHandle, invented+alpnTokenSuffix, |
| + hostCertPEM(t, invented, time.Now().Add(24*time.Hour))) |
| + if _, _, ok := edgeB.edge.homes.Load().Home(invented); !ok { |
| + t.Fatal("test bug: the invented label is supposed to be DIALABLE through the one-label rule") |
| + } |
| + if c := edgeB.mirror.alpnTokenCert(context.Background(), invented); c != nil { |
| t.Fatal("a label under a mirrored catch-all was served a token cert") |
| } |
| }) |