From 80b12a6eeca403ee118d19b6fe029e13a7dfa2ff Mon Sep 17 00:00:00 2001 From: James Munnelly Date: Wed, 18 Apr 2018 19:24:09 +0100 Subject: [PATCH 1/2] Add e2e test to ensure we can obtain certificates for dnsNames >100 chars --- test/e2e/certificate/certificate_acme.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/e2e/certificate/certificate_acme.go b/test/e2e/certificate/certificate_acme.go index d82f6e54e..7930fbfe2 100644 --- a/test/e2e/certificate/certificate_acme.go +++ b/test/e2e/certificate/certificate_acme.go @@ -98,6 +98,13 @@ var _ = framework.CertManagerDescribe("ACME Certificate (HTTP01)", func() { f.WaitCertificateIssuedValid(cert) }) + It("should obtain a signed certificate for a long (more than 100 chars) domain using http01 validation", func() { + By("Creating a Certificate") + cert, err := f.CertManagerClientSet.CertmanagerV1alpha1().Certificates(f.Namespace.Name).Create(util.NewCertManagerACMECertificate(certificateName, certificateSecretName, issuerName, v1alpha1.IssuerKind, acmeIngressClass, fmt.Sprintf("%s.%s", cmutil.RandStringRunes(100), util.ACMECertificateDomain))) + Expect(err).NotTo(HaveOccurred()) + f.WaitCertificateIssuedValid(cert) + }) + It("should obtain a signed certificate with a CN and single subdomain as dns name from the ACME server", func() { By("Creating a Certificate") cert, err := f.CertManagerClientSet.CertmanagerV1alpha1().Certificates(f.Namespace.Name).Create(util.NewCertManagerACMECertificate(certificateName, certificateSecretName, issuerName, v1alpha1.IssuerKind, acmeIngressClass, util.ACMECertificateDomain, fmt.Sprintf("%s.%s", cmutil.RandStringRunes(5), util.ACMECertificateDomain))) From c876f00c7b309ba8c733bcbb7df4951b480ed5b7 Mon Sep 17 00:00:00 2001 From: James Munnelly Date: Thu, 19 Apr 2018 09:57:08 +0100 Subject: [PATCH 2/2] Adjust max segment length to 63 chars --- test/e2e/certificate/certificate_acme.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/e2e/certificate/certificate_acme.go b/test/e2e/certificate/certificate_acme.go index 7930fbfe2..476b19fd8 100644 --- a/test/e2e/certificate/certificate_acme.go +++ b/test/e2e/certificate/certificate_acme.go @@ -98,9 +98,11 @@ var _ = framework.CertManagerDescribe("ACME Certificate (HTTP01)", func() { f.WaitCertificateIssuedValid(cert) }) - It("should obtain a signed certificate for a long (more than 100 chars) domain using http01 validation", func() { + It("should obtain a signed certificate for a long domain using http01 validation", func() { + // the maximum length of a single segment of the domain being requested + const maxLengthOfDomainSegment = 63 By("Creating a Certificate") - cert, err := f.CertManagerClientSet.CertmanagerV1alpha1().Certificates(f.Namespace.Name).Create(util.NewCertManagerACMECertificate(certificateName, certificateSecretName, issuerName, v1alpha1.IssuerKind, acmeIngressClass, fmt.Sprintf("%s.%s", cmutil.RandStringRunes(100), util.ACMECertificateDomain))) + cert, err := f.CertManagerClientSet.CertmanagerV1alpha1().Certificates(f.Namespace.Name).Create(util.NewCertManagerACMECertificate(certificateName, certificateSecretName, issuerName, v1alpha1.IssuerKind, acmeIngressClass, fmt.Sprintf("%s.%s", cmutil.RandStringRunes(maxLengthOfDomainSegment), util.ACMECertificateDomain))) Expect(err).NotTo(HaveOccurred()) f.WaitCertificateIssuedValid(cert) })