I've getting the following error trying to configure the Elasticsearch watcher with webhooks to connect to Microsoft Teams:
s_s_l_exception:Unrecognized SSL message, plaintext connection?
This is my config:
"metadata" : {
"color" : "green"
},
"trigger" : {
"schedule" : {
"interval" : "1m"
}
},
"input" : {
"http" : {
"request" : {
"host" : "....",
"port" : 9200,
"path" : "/_cluster/health"
}
}
},
"condition" : {
"compare" : {
"ctx.payload.status" : { "eq" : "green" }
}
},
"actions" : {
"teams_webhook" : {
"webhook" : {
"method" : "POST",
"url" : "https://outlook.office.com/webhook/...",
"headers" : {
"Content-Type" : "application/json",
"Accept" : "application/json"
},
"proxy" : {
"host" : "zz.zzz.com",
"port" : 8080
},
"body" : "{{#toJson}}{{ctx.payload.hits.total}}{{/toJson}}}"
}
}
}
I've tried to disable ssl authentication as best I can through elasticsearch.yml though I get the same issue:
xpack.http.ssl.verification_mode: none
xpack.ssl.verification_mode: none
xpack.http.proxy.host: zzz.zzzz.zzzz
xpack.http.proxy.port: 8080
xpack.ssl.client_authentication: none
The input and conditions return a status of 200 and success though the actions section returns an exception "s_s_l_exception":"Unrecognized SSL message, plaintext connection?" which I suspect is caused by the proxy. I've managed to successfully post to teams using the proxy with curl and postman so I'm struggling to find a solution. I've managed to use the host:8080 proxy host port to send to Microsoft teams with curl and postman by setting the https proxy within postman and using export https_proxy=http://zzz.zzz.zzz:8080 alongside curl.
Does anyone know what the issue is with my config or how I'm configuring the webhook?