HTTPS for HttpSink

This commit is contained in:
Thomas Roehl 2022-02-04 12:39:25 +01:00
parent db02c89683
commit 02cd21abe2

View File

@ -26,7 +26,11 @@ func (s *HttpSink) Init(config sinkConfig) error {
} }
s.client = &http.Client{} s.client = &http.Client{}
s.url = fmt.Sprintf("http://%s:%s/%s", config.Host, config.Port, config.Database) proto := "http"
if config.SSL {
proto = "https"
}
s.url = fmt.Sprintf("%s://%s:%s/%s", proto, config.Host, config.Port, config.Database)
s.port = config.Port s.port = config.Port
s.jwt = config.Password s.jwt = config.Password
s.buffer = &bytes.Buffer{} s.buffer = &bytes.Buffer{}