[TASK] allow self-signed certification in influxdb
This commit is contained in:
parent
71c3e5ffe4
commit
9c886d497e
|
@ -45,6 +45,12 @@ func (c Config) Username() string {
|
|||
func (c Config) Password() string {
|
||||
return c["password"].(string)
|
||||
}
|
||||
func (c Config) InsecureSkipVerify() bool {
|
||||
if d, ok := c["insecure_skip_verify"]; ok {
|
||||
return d.(bool)
|
||||
}
|
||||
return false
|
||||
}
|
||||
func (c Config) Tags() map[string]interface{} {
|
||||
if c["tags"] != nil {
|
||||
return c["tags"].(map[string]interface{})
|
||||
|
@ -64,6 +70,7 @@ func Connect(configuration map[string]interface{}) (database.Connection, error)
|
|||
Addr: config.Address(),
|
||||
Username: config.Username(),
|
||||
Password: config.Password(),
|
||||
InsecureSkipVerify: config.InsecureSkipVerify(),
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
|
|
@ -19,6 +19,7 @@ func TestConnect(t *testing.T) {
|
|||
"address": "",
|
||||
"username": "",
|
||||
"password": "",
|
||||
"insecure_skip_verify": true,
|
||||
})
|
||||
assert.Nil(conn)
|
||||
assert.Error(err)
|
||||
|
|
|
@ -569,6 +569,7 @@ address = "http://localhost:8086"
|
|||
database = "ffhb"
|
||||
username = ""
|
||||
password = ""
|
||||
insecure_skip_verify = false
|
||||
[database.connection.influxdb.tags]
|
||||
tagname1 = "tagvalue 1"
|
||||
system = "productive"
|
||||
|
@ -616,6 +617,15 @@ password = ""
|
|||
```
|
||||
{% endmethod %}
|
||||
|
||||
### insecure_skip_verify
|
||||
{% method %}
|
||||
Skip insecure verify for self-signed certificates.
|
||||
{% sample lang="toml" %}
|
||||
```toml
|
||||
insecure_skip_verify = true
|
||||
```
|
||||
{% endmethod %}
|
||||
|
||||
|
||||
### [database.connection.influxdb.tags]
|
||||
{% method %}
|
||||
|
|
Loading…
Reference in New Issue