Merge branch 'influxdb-selfsign' into 'master'
[TASK] allow self-signed certification in influxdb See merge request FreifunkBremen/yanic!135
This commit is contained in:
commit
cf8aeeeb78
|
@ -45,6 +45,12 @@ func (c Config) Username() string {
|
||||||
func (c Config) Password() string {
|
func (c Config) Password() string {
|
||||||
return c["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{} {
|
func (c Config) Tags() map[string]interface{} {
|
||||||
if c["tags"] != nil {
|
if c["tags"] != nil {
|
||||||
return c["tags"].(map[string]interface{})
|
return c["tags"].(map[string]interface{})
|
||||||
|
@ -64,6 +70,7 @@ func Connect(configuration map[string]interface{}) (database.Connection, error)
|
||||||
Addr: config.Address(),
|
Addr: config.Address(),
|
||||||
Username: config.Username(),
|
Username: config.Username(),
|
||||||
Password: config.Password(),
|
Password: config.Password(),
|
||||||
|
InsecureSkipVerify: config.InsecureSkipVerify(),
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -19,6 +19,7 @@ func TestConnect(t *testing.T) {
|
||||||
"address": "",
|
"address": "",
|
||||||
"username": "",
|
"username": "",
|
||||||
"password": "",
|
"password": "",
|
||||||
|
"insecure_skip_verify": true,
|
||||||
})
|
})
|
||||||
assert.Nil(conn)
|
assert.Nil(conn)
|
||||||
assert.Error(err)
|
assert.Error(err)
|
||||||
|
|
|
@ -569,6 +569,7 @@ address = "http://localhost:8086"
|
||||||
database = "ffhb"
|
database = "ffhb"
|
||||||
username = ""
|
username = ""
|
||||||
password = ""
|
password = ""
|
||||||
|
insecure_skip_verify = false
|
||||||
[database.connection.influxdb.tags]
|
[database.connection.influxdb.tags]
|
||||||
tagname1 = "tagvalue 1"
|
tagname1 = "tagvalue 1"
|
||||||
system = "productive"
|
system = "productive"
|
||||||
|
@ -616,6 +617,15 @@ password = ""
|
||||||
```
|
```
|
||||||
{% endmethod %}
|
{% 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]
|
### [database.connection.influxdb.tags]
|
||||||
{% method %}
|
{% method %}
|
||||||
|
|
Loading…
Reference in New Issue