Watcher webhook outlook ssl exception

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?

Hey,

yes, this is a bug on our side, if the scheme of the HTTP proxy is different to the scheme of the request, in this case HTTP for the proxy and HTTPS for the request.

We are working on a fix.

--Alex

What it means ?
I am also trying to send notification using webhook url and I am unable to do it.
Its giving me error : SSLHandshakeException[Received fatal alert: handshake_failure]
Is there any workaround for the same?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.