Skip to content

Conversation

nemith
Copy link
Contributor

@nemith nemith commented Apr 26, 2019

Description

With the driver.Connector interface you can skip using string based DSNs
and use a Config object directly with Connector. However the logic to
create the tls.Config is only found in parseDSNParams.

This keeps the string parsing logic in parseDSNParams but moves the tls
generation logic into Config.normalize.

This is still less than ideal since we cannot directly pass in
tls.Config into Config and have it be used, but it is sill backwards
compatible. In the future this should be revisited to be able to use a
custom tls.Config passed directly in without string
parsing/registering.

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

nemith and others added 2 commits April 26, 2019 14:50
With the driver.Connector interface you can skip using string based DSNs
and use a Config object directly with Connector.  However the logic to
create the tls.Config is only found in parseDSNParams.

This keeps the string parsing logic in parseDSNParams but moves the tls
generation logic into Config.normalize.

This is still less than ideal since we cannot directly pass in
tls.Config into Config and have it be used, but it is sill backwards
compatable.  In the future this should be revisited to be able to use a
custome tls.Config passed directly in without string
parsing/registering.
Like the tlsConfig.  pubKey was only set when the dsn was parsed.  With
Connector interface DSNs are not longer needed so this moves it to
normalize which will be called when the connector is initialized.
@nemith nemith changed the title move tls config logic to normalize move tls/pubkey object creation to Config.normalize() Apr 29, 2019
Increase the test coverage of dsn.go
@nemith
Copy link
Contributor Author

nemith commented May 2, 2019

Ping?

@julienschmidt julienschmidt added this to the v1.5.0 milestone May 7, 2019
@methane methane merged commit 877a977 into go-sql-driver:master May 10, 2019
@dolmen
Copy link
Contributor

dolmen commented Jun 1, 2020

@nemith #1045 should interest you.

tz70s pushed a commit to tz70s/mysql that referenced this pull request Sep 5, 2020
…ver#958)

This is still less than ideal since we cannot directly pass in
tls.Config into Config and have it be used, but it is sill backwards
compatable.  In the future this should be revisited to be able to use a
custome tls.Config passed directly in without string
parsing/registering.
tz70s pushed a commit to tz70s/mysql that referenced this pull request Sep 5, 2020
…ver#958)

This is still less than ideal since we cannot directly pass in
tls.Config into Config and have it be used, but it is sill backwards
compatable.  In the future this should be revisited to be able to use a
custome tls.Config passed directly in without string
parsing/registering.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants