sensu-plugins / sensu-plugins-slack

Sensu Slack chat handlers
http://sensu-plugins.io
MIT License
30 stars 54 forks source link

Slack forces SSL/TLS for all endpoints, even http #74

Open zamedic opened 5 years ago

zamedic commented 5 years ago

if we use an internal slack compatible endpoint that uses http - then the line below breaks the request, since it forced the request to use https...

https://github.com/sensu-plugins/sensu-plugins-slack/blob/6bef292b5e460b5760aa5b61e0ac446b04833e07/bin/handler-slack.rb#L150

the error we receive is

{"timestamp":"2019-01-23T12:19:56.779398+0200","level":"error","message":"handler output","handler":{"type":"pipe","severities":["ok","warning","critical","unknown"],"command":"handler-slack.rb -j slack_chopchop","name":"slack_chopchop"},"event":{"id":"a5c5eb89-300f-4a3b-82f8-e10c54bedf4b"},"output":["/opt/sensu/embedded/lib/ruby/2.4.0/net/protocol.rb:44:in connect_nonblock': SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol (OpenSSL::SSL::SSLError)\n\tfrom /opt/sensu/embedded/lib/ruby/2.4.0/net/protocol.rb:44:inssl_socket_connect'\n\tfrom /opt/sensu/embedded/lib/ruby/2.4.0/net/http.rb:948:in connect'\n\tfrom /opt/sensu/embedded/lib/ruby/2.4.0/net/http.rb:887:indo_start'\n\tfrom /opt/sensu/embedded/lib/ruby/2.4.0/net/http.rb:876:in start'\n\tfrom /opt/sensu/embedded/lib/ruby/2.4.0/net/http.rb:1407:inrequest'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-slack-3.1.1/bin/handler-slack.rb:161:in post_data'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-slack-3.1.1/bin/handler-slack.rb:113:inhandle'\n\tfrom /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugin-2.7.0/lib/sensu-handler.rb:89:in `block in '\n"]}

majormoses commented 5 years ago

Is there some reason you can't use something like Let's Encrypt or a self signed certificate? I am hesitant to enable poor security posture.