From dcbe0c7c7987a88bebbfed89e80963d9174a42b1 Mon Sep 17 00:00:00 2001 From: troyready Date: Wed, 3 Aug 2016 08:15:16 -0700 Subject: [PATCH] fix windows aws ssl cert verification The sensu ruby install on Windows doesn't include the proper certs (or if it does they're not loaded properly) to connect to AWS. `@sns.publish` generates an error like: ``` C:/opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:921:in `connect': SSL_connect returned=1 errno=0 state=error: certificate verify failed (Seahorse::Client::NetworkingError) ``` Using the cert bundle included with the aws-sdk-core gem should work around this. Sourced from https://github.com/aws/aws-sdk-core-ruby/issues/166#issuecomment-111603660 --- lib/sensu/transport/snssqs.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/sensu/transport/snssqs.rb b/lib/sensu/transport/snssqs.rb index 2c40ce3..c9309b3 100644 --- a/lib/sensu/transport/snssqs.rb +++ b/lib/sensu/transport/snssqs.rb @@ -34,6 +34,8 @@ def connect(settings) @connected = true @results_callback = proc {} @keepalives_callback = proc {} + # Sensu Windows install does not include a valid cert bundle for AWS + Aws.use_bundled_cert! if Gem.win_platform? @sqs = Aws::SQS::Client.new(region: @settings[:region]) @sns = Aws::SNS::Client.new(region: @settings[:region])