[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 {
|
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{})
|
||||||
@ -61,9 +67,10 @@ func Connect(configuration map[string]interface{}) (database.Connection, error)
|
|||||||
|
|
||||||
// Make client
|
// Make client
|
||||||
c, err := client.NewHTTPClient(client.HTTPConfig{
|
c, err := client.NewHTTPClient(client.HTTPConfig{
|
||||||
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 {
|
||||||
|
@ -16,9 +16,10 @@ func TestConnect(t *testing.T) {
|
|||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
conn, err := Connect(map[string]interface{}{
|
conn, err := Connect(map[string]interface{}{
|
||||||
"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
Block a user