Skip to content

Commit

Permalink
update: 支持当开启ssl时的binlog解析
Browse files Browse the repository at this point in the history
  • Loading branch information
hanchuanchuan committed Dec 18, 2020
1 parent a4b1e20 commit 2373c1b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions session/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package session

import (
"context"
"crypto/tls"
"database/sql/driver"
"encoding/hex"
"fmt"
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 2373c1b

Please sign in to comment.