Skip to content

make tls=true do the same thing as tls=. otherwise it's pretty useless. #543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

toshok
Copy link

@toshok toshok commented Feb 2, 2017

Description

tls=true in the dsn creates an empty tls.Config{}, which when used results in the error:

either ServerName or InsecureSkipVerify must be specified in the tls.Config

This change makes tls=true behave the same as tls=, that is it uses the hostname portion of the addr as the ServerName.

Fixes #527

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

@@ -293,11 +293,11 @@ Default: OS default

```
Type: bool / string
Valid Values: true, false, skip-verify, <name>
Valid Values: true, false, skip-verify, <name>, <empty>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I agree that we need a fix for tls=true, <empty> should not be a valid (/recommended) value. It doesn't make sense semantically and is the same as tls=true, I assume?

Default: false
```

`tls=true` enables TLS / SSL encrypted connection to the server. Use `skip-verify` if you want to use a self-signed or invalid certificate (server side). Use a custom value registered with [`mysql.RegisterTLSConfig`](https://godoc.org/github.com/go-sql-driver/mysql#RegisterTLSConfig).
Every value other than `false` enables TLS/SSL encrypted connection to the server. Use `skip-verify` if you want to use a self-signed or invalid certificate (server side). Use a custom `<name>` if you've registered it with [`mysql.RegisterTLSConfig`](https://godoc.org/github.com/go-sql-driver/mysql#RegisterTLSConfig). Both `true` and `<empty>` will use use the `host` from the address for the expected `ServerName`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not add double spaces after full stops.

@julienschmidt julienschmidt added this to the v1.4 milestone Mar 27, 2017
@julienschmidt
Copy link
Member

Fixed by #564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants