Skip to content
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

Add option to skip tls hostname verification #417

Merged
merged 4 commits into from Aug 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* [ENHANCEMENT]
* [FEATURE]

* [FEATURE] Add `tls.insecure-skip-verify` flag to ignore tls verification errors (PR #417) #348

## 0.12.1 / 2019-07-10

### Changes:
Expand Down
5 changes: 5 additions & 0 deletions mysqld_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ var (
"config.my-cnf",
"Path to .my.cnf file to read MySQL credentials from.",
).Default(path.Join(os.Getenv("HOME"), ".my.cnf")).String()
tlsInsecureSkipVerify = kingpin.Flag(
"tls.insecure-skip-verify",
"Ignore certificate and server verification when using a tls connection.",
).Bool()
dsn string
)

Expand Down Expand Up @@ -150,6 +154,7 @@ func customizeTLS(sslCA string, sslCert string, sslKey string) error {
}
certPairs = append(certPairs, keypair)
tlsCfg.Certificates = certPairs
tlsCfg.InsecureSkipVerify = *tlsInsecureSkipVerify
}
mysql.RegisterTLSConfig("custom", &tlsCfg)
return nil
Expand Down