Skip to content

Commit 60d9485

Browse files
committed
Comment changes only
1. Remove comment about "extend the use of url.Parse" because that was in fact done in commit 53c3b91 2. Add godoc style comment explaining `SetCustomTLSConfig`
1 parent 09ab351 commit 60d9485

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

driver/driver.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,16 @@ func init() {
264264
sql.Register("mysql", driver{})
265265
}
266266

267+
268+
// SetCustomTLSConfig sets a custom TLSConfig for the address (host:port) of the supplied DSN.
269+
// It requires a full import of the driver (not by side-effects only).
270+
// Example of supplying a custom CA, no client cert, no key, validating the
271+
// certificate, and supplying a serverName for the validation:
272+
//
273+
// driver.SetCustomTLSConfig(CaPem, make([]byte, 0), make([]byte, 0), false, "my.domain.name")
274+
//
267275
func SetCustomTLSConfig(dsn string, caPem []byte, certPem []byte, keyPem []byte, insecureSkipVerify bool, serverName string) error {
268276
// Extract addr from dsn
269-
// We can hopefully extend the use of url.Parse if we switch the DSN style
270277
parsed, err := url.Parse(dsn)
271278
if err != nil {
272279
return errors.Errorf("Unable to parse DSN. Need to extract address to use as key for storing custom TLS config")

0 commit comments

Comments
 (0)