Skip to content

Commit

Permalink
fix windows aws ssl cert verification
Browse files Browse the repository at this point in the history
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 amazon-archives/aws-sdk-core-ruby#166 (comment)
  • Loading branch information
troyready committed Nov 8, 2016
1 parent 842affe commit ce7a827
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/sensu/transport/snssqs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down

0 comments on commit ce7a827

Please sign in to comment.