Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.

Commit fc5842a

Browse files
committed
Reference commit for setting custom TLS config
Using changes per here: go-mysql-org/go-mysql#673
1 parent 5f92603 commit fc5842a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

adaptor/mysql/client.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/compose/transporter/client"
99

1010
//_ "github.com/go-sql-driver/mysql" // import mysql driver
11-
_ "github.com/go-mysql-org/go-mysql/driver" // import alternative mysql driver
11+
"github.com/go-mysql-org/go-mysql/driver" // import alternative mysql driver
1212
)
1313

1414
const (
@@ -19,6 +19,10 @@ const (
1919

2020
var (
2121
_ client.Client = &Client{}
22+
CaPem = []byte(`-----BEGIN CERTIFICATE-----
23+
CERTHERE
24+
-----END CERTIFICATE-----`)
25+
2226
)
2327

2428
// ClientOptionFunc is a function that configures a Client.
@@ -110,5 +114,8 @@ func (c *Client) Connect() (client.Session, error) {
110114
// We need to disable Foreign Key Checks for imports
111115
// Ideally we don't want to send this _every_ time just once per session
112116
_, err = c.mysqlSession.Exec("SET FOREIGN_KEY_CHECKS=0;")
117+
// Set custom TLS Config?
118+
driver.SetCustomTLSConfig(CaPem, make([]byte, 0), make([]byte, 0), false, "af3e1bf4-9742-400b-8fe2-c69a2a533b52.c1vt02ul0q3fa0509bog.databases.appdomain.cloud")
119+
113120
return &Session{c.mysqlSession, c.db}, err
114121
}

0 commit comments

Comments
 (0)