You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is pretty rudimentary, but good enough to start a PR and
review/discussion for how it should end up.
- There is just a single custom config called `custom`
- A program using the driver can only have one custom config. That
"works for me", but for people using the driver in a single program to
communicate with different endpoints that probably isn't going to work
- Adds a basic "wrapper" function `SetCustomTLSConfig` which passes
through to `NewClientTLSConfig`. This means just the driver can be
imported.
To use this you'd do:
```
import (
"database/sql"
"net/url"
"github.com/go-mysql-org/go-mysql/driver" // full import required
)
[...]
var (
CaPem = []byte(`-----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----`)
)
[...]
// CA and domain, no Cert and Key
driver.SetCustomTLSConfig(CaPem, make([]byte, 0), make([]byte, 0), false, "my.domain.com")
[...]
```
0 commit comments