From 2373c1b10601d7583ca640c938bf6772f241026a Mon Sep 17 00:00:00 2001 From: hanchuanchuan Date: Fri, 18 Dec 2020 17:21:45 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=94=AF=E6=8C=81=E5=BD=93=E5=BC=80?= =?UTF-8?q?=E5=90=AFssl=E6=97=B6=E7=9A=84binlog=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- session/parser.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/session/parser.go b/session/parser.go index 477fcd168..ff1585b36 100644 --- a/session/parser.go +++ b/session/parser.go @@ -2,6 +2,7 @@ package session import ( "context" + "crypto/tls" "database/sql/driver" "encoding/hex" "fmt" @@ -234,6 +235,13 @@ func (s *session) parserBinlog(ctx context.Context) { // SemiSyncEnabled: p.cfg.SemiSync, } + if s.opt.ssl != "" { + switch s.opt.ssl { + case "preferred", "true", "required": + cfg.TLSConfig = &tls.Config{InsecureSkipVerify: true} + } + } + b := replication.NewBinlogSyncer(cfg) defer b.Close()