MCPcopy
hub / github.com/redis/go-redis / TestTLSRedissURL

Function TestTLSRedissURL

tls_standalone_test.go:53–76  ·  view source on GitHub ↗

TestTLSRedissURL tests rediss:// URL scheme

(t *testing.T)

Source from the content-addressed store, hash-verified

51
52// TestTLSRedissURL tests rediss:// URL scheme
53func TestTLSRedissURL(t *testing.T) {
54 opt, err := redis.ParseURL("rediss://localhost:6666")
55 if err != nil {
56 t.Fatalf("ParseURL failed: %v", err)
57 }
58
59 // Override TLS config to skip verification for self-signed certs
60 opt.TLSConfig = &tls.Config{
61 InsecureSkipVerify: true,
62 }
63
64 client := redis.NewClient(opt)
65 defer client.Close()
66
67 val, err := client.Ping(ctx).Result()
68 if err != nil {
69 t.Fatalf("PING failed: %v", err)
70 }
71 if val != "PONG" {
72 t.Fatalf("Expected PONG, got %s", val)
73 }
74
75 t.Log("✅ TLS rediss:// URL test passed")
76}

Callers

nothing calls this directly

Calls 3

CloseMethod · 0.65
ResultMethod · 0.65
PingMethod · 0.65

Tested by

no test coverage detected