File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ Carlos Nieto <jose.carlos at menteslibres.net>
1818Chris Moos <chris at tech9computers.com>
1919Daniel Nichter <nil at codenode.com>
2020Daniël van Eeden <git at myname.nl>
21+ Dave Protasowski <dprotaso at gmail.com>
2122DisposaBoy <disposaboy at dby.me>
2223Egor Smolyakov <egorsmkv at gmail.com>
2324Frederick Mayle <frederickmayle at gmail.com>
@@ -46,6 +47,7 @@ Nicola Peduzzi <thenikso at gmail.com>
4647Olivier Mengué <dolmen at cpan.org>
4748Paul Bonser <misterpib at gmail.com>
4849Peter Schultz <peter.schultz at classmarkets.com>
50+ Rebecca Chin <rchin at pivotal.io>
4951Runrioter Wung <runrioter at gmail.com>
5052Soroush Pour <me at soroushjp.com>
5153Stan Putrya <root.vagner at gmail.com>
@@ -60,3 +62,4 @@ Zhenye Xie <xiezhenye at gmail.com>
6062Barracuda Networks, Inc.
6163Google Inc.
6264Stripe Inc.
65+ Pivotal Inc.
Original file line number Diff line number Diff line change @@ -511,6 +511,8 @@ func parseDSNParams(cfg *Config, params string) (err error) {
511511 }
512512
513513 if tlsConfig , ok := tlsConfigRegister [name ]; ok {
514+ tlsConfig = tlsConfig .Clone ()
515+
514516 if len (tlsConfig .ServerName ) == 0 && ! tlsConfig .InsecureSkipVerify {
515517 host , _ , err := net .SplitHostPort (cfg .Addr )
516518 if err == nil {
Original file line number Diff line number Diff line change @@ -159,6 +159,8 @@ func TestDSNWithCustomTLS(t *testing.T) {
159159 t .Error (err .Error ())
160160 } else if cfg .tls .ServerName != name {
161161 t .Errorf ("did not get the correct ServerName (%s) parsing DSN (%s)." , name , tst )
162+ } else if tlsCfg .ServerName != "" {
163+ t .Errorf ("tlsCfg was mutated ServerName (%s) should be empty parsing DSN (%s)." , name , tst )
162164 }
163165
164166 DeregisterTLSConfig ("utils_test" )
You can’t perform that action at this time.
0 commit comments