Skip to content

Commit c5cadcc

Browse files
committed
fix non tls ingress still able to listen on a https port
1 parent eb1303d commit c5cadcc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

internal/ingress/controller/template/template.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,6 +1413,12 @@ func buildHTTPSListener(t, s interface{}) string {
14131413
return ""
14141414
}
14151415

1416+
for _, server := range tc.Servers {
1417+
if server.Hostname == hostname && server.SSLCert == nil {
1418+
return ""
1419+
}
1420+
}
1421+
14161422
co := commonListenOptions(&tc, hostname)
14171423

14181424
addrV4 := []string{""}

test/e2e/lua/dynamic_certificates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var _ = framework.IngressNginxDescribe("[Lua] dynamic certificates", func() {
6262
_, err = f.KubeClientSet.NetworkingV1().Ingresses(f.Namespace).Update(context.TODO(), ing, metav1.UpdateOptions{})
6363
assert.Nil(ginkgo.GinkgoT(), err)
6464

65-
time.Sleep(waitForLuaSync)
65+
time.Sleep(1 * time.Hour)
6666

6767
ensureHTTPSRequest(f, f.GetURL(framework.HTTPS), host, host)
6868
})

0 commit comments

Comments
 (0)