AlinsRan commented on code in PR #1533: URL: https://github.com/apache/apisix-ingress-controller/pull/1533#discussion_r1062139476
########## test/e2e/suite-ingress/suite-ingress-resource/stream.go: ########## @@ -214,4 +223,82 @@ spec: assert.Equal(ginkgo.GinkgoT(), sr[0].ServerPort, int32(9100)) assert.Equal(ginkgo.GinkgoT(), sr[0].SNI, "") }) + + ginkgo.It("stream tcp proxy with SNI", func() { + // create secrets + host := "a.test.com" + secret := "server-secret" + serverCert, serverKey := generateCert(ginkgo.GinkgoT(), []string{host}) + err := s.NewSecret(secret, serverCert.String(), serverKey.String()) + assert.Nil(ginkgo.GinkgoT(), err, "create server cert secret error") + + // create ApisixTls resource + err = s.NewApisixTls("tls-server", host, secret) + assert.Nil(ginkgo.GinkgoT(), err, "create ApisixTls error") + + // check ssl in APISIX + assert.Nil(ginkgo.GinkgoT(), s.EnsureNumApisixTlsCreated(1)) + + backendSvc, backendSvcPort := s.DefaultHTTPBackend() + apisixRoute := fmt.Sprintf(` +apiVersion: apisix.apache.org/v2 +kind: ApisixRoute +metadata: + name: httpbin-tcp-route +spec: + stream: + - name: rule1 + protocol: TCP + match: + ingressPort: 9110 + host: %s + backend: + serviceName: %s + servicePort: %d +`, host, backendSvc, backendSvcPort[0]) + + assert.Nil(ginkgo.GinkgoT(), s.CreateVersionedApisixResource(apisixRoute)) + + err = s.EnsureNumApisixStreamRoutesCreated(1) + assert.Nil(ginkgo.GinkgoT(), err, "Checking number of routes") + + client := s.NewAPISIXClientWithTLSOverTCP(host) Review Comment: I recommend adding the use of other host cases here to ensure that the configured sni is valid. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org