Skip to content

Commit d477103

Browse files
committed
use TLS for redis.
1 parent 90be19f commit d477103

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

backend/cmd/srv/main.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"context"
5+
"crypto/tls"
56
"flag"
67
"fmt"
78
"github.com/redis/go-redis/v9"
@@ -55,7 +56,10 @@ func run(ctx context.Context) error {
5556
Addr: zyg.RedisAddr(),
5657
Username: zyg.RedisUsername(),
5758
Password: zyg.RedisPassword(),
58-
DB: 0,
59+
TLSConfig: &tls.Config{
60+
InsecureSkipVerify: true,
61+
},
62+
DB: 0,
5963
})
6064

6165
defer func(rdb *redis.Client) {

backend/cmd/xsrv/main.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"context"
5+
"crypto/tls"
56
"flag"
67
"fmt"
78
"github.com/redis/go-redis/v9"
@@ -55,7 +56,10 @@ func run(ctx context.Context) error {
5556
Addr: zyg.RedisAddr(),
5657
Username: zyg.RedisUsername(),
5758
Password: zyg.RedisPassword(),
58-
DB: 0,
59+
TLSConfig: &tls.Config{
60+
InsecureSkipVerify: true,
61+
},
62+
DB: 0,
5963
})
6064

6165
defer func(rdb *redis.Client) {

0 commit comments

Comments
 (0)