I'm trying to submit logs to the HTTP Event Collector from a go application. I've correctly setup the Event Collector (I can successfully curl it), however I see the following error when I submit a POST:
2016/01/14 16:37:03 utils.go:75 utils.splunkit ERROR Post https://52.18.170.31:9000/services/collector/event: x509: cannot validate certificate for 52.18.170.31 because it doesn't contain any IP SANs
Here is a code snipet of how I am posting to splunk:
func splunkit(host string, port int, token string, data []byte) {
body := bytes.NewReader(data)
url := fmt.Sprintf("https://%s:%d/services/collector/event", host, port)
client := &http.Client{}
req, err := http.NewRequest("POST", url, body)
req.Header.Add("Authorization", "Splunk "+token)
resp, err := client.Do(req)
if err == nil {
log.Info(resp)
} else {
log.Error(err)
}
}
How I can use a certificate on the client side in order to successfully submit logs to splunk directly from my app??
↧