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

Commit

Permalink
Reference commit for setting custom TLS config
Browse files Browse the repository at this point in the history
Using changes per here: go-mysql-org/go-mysql#673
  • Loading branch information
atomicules committed Feb 8, 2022
1 parent 5f92603 commit fc5842a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion adaptor/mysql/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/compose/transporter/client"

//_ "github.com/go-sql-driver/mysql" // import mysql driver
_ "github.com/go-mysql-org/go-mysql/driver" // import alternative mysql driver
"github.com/go-mysql-org/go-mysql/driver" // import alternative mysql driver
)

const (
Expand All @@ -19,6 +19,10 @@ const (

var (
_ client.Client = &Client{}
CaPem = []byte(`-----BEGIN CERTIFICATE-----
CERTHERE
-----END CERTIFICATE-----`)

)

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

return &Session{c.mysqlSession, c.db}, err
}

0 comments on commit fc5842a

Please sign in to comment.