MCPcopy Create free account
hub / github.com/Shopify/ghostferry / BuildConfig

Method BuildConfig

config.go:35–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33}
34
35func (this *TLSConfig) BuildConfig() (*tls.Config, error) {
36 if this.tlsConfig == nil {
37 certPool := x509.NewCertPool()
38 pem, err := ioutil.ReadFile(this.CertPath)
39 if err != nil {
40 return nil, err
41 }
42
43 if ok := certPool.AppendCertsFromPEM(pem); !ok {
44 return nil, errors.New("unable to append pem")
45 }
46
47 this.tlsConfig = &tls.Config{
48 RootCAs: certPool,
49 ServerName: this.ServerName,
50 }
51 }
52
53 return this.tlsConfig, nil
54}
55
56type DatabaseConfig struct {
57 Host string

Callers 5

createBinlogSyncerMethod · 0.80
MySQLConfigMethod · 0.80
TestCorruptCertMethod · 0.80

Calls

no outgoing calls

Tested by 3

TestCorruptCertMethod · 0.64