diff options
author | 2025-03-07 04:34:59 -0500 | |
---|---|---|
committer | 2025-03-10 20:37:16 +0000 | |
commit | 067c66f80ea2173d605ecf741fe5caca82b23606 (patch) | |
tree | fcf7ac28a4bdfa5f790df255c083ec021eba9ae2 /extras/hs-test | |
parent | 0e503263c2a594eecb069a79b02487a951fb24cf (diff) |
http: http_transport_connect TLS support
enable HTTPS for client apps
Type: improvement
Change-Id: I2ca8b926771a350863cca81729102faf6ee9c874
Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'extras/hs-test')
-rw-r--r-- | extras/hs-test/http_test.go | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/extras/hs-test/http_test.go b/extras/hs-test/http_test.go index 91d0823d9c3..ad43f9d032e 100644 --- a/extras/hs-test/http_test.go +++ b/extras/hs-test/http_test.go @@ -22,7 +22,7 @@ import ( ) func init() { - RegisterVethTests(HttpCliTest, HttpCliConnectErrorTest) + RegisterVethTests(HttpCliTest, HttpCliConnectErrorTest, HttpCliTlsTest) RegisterSoloVethTests(HttpClientGetMemLeakTest) RegisterNoTopoTests(HeaderServerTest, HttpPersistentConnectionTest, HttpPipeliningTest, HttpStaticMovedTest, HttpStaticNotFoundTest, HttpCliMethodNotAllowedTest, HttpAbsoluteFormUriTest, @@ -241,6 +241,25 @@ func HttpCliTest(s *VethsSuite) { s.AssertContains(o, "</html>", "</html> not found in the result!") } +func HttpCliTlsTest(s *VethsSuite) { + uri := "tls://" + s.Interfaces.Server.Ip4AddressString() + "/443" + + s.Containers.ServerVpp.VppInstance.Vppctl("http cli server uri " + uri) + + o := s.Containers.ClientVpp.VppInstance.Vppctl("http cli client" + + " uri " + uri + " query /show/version") + s.Log(o) + s.AssertContains(o, "<html>", "<html> not found in the result!") + s.AssertContains(o, "</html>", "</html> not found in the result!") + + /* second request to test postponed ho-cleanup */ + o = s.Containers.ClientVpp.VppInstance.Vppctl("http cli client" + + " uri " + uri + " query /show/version") + s.Log(o) + s.AssertContains(o, "<html>", "<html> not found in the result!") + s.AssertContains(o, "</html>", "</html> not found in the result!") +} + func HttpCliConnectErrorTest(s *VethsSuite) { uri := "http://" + s.Interfaces.Server.Ip4AddressString() + "/80" |