Posting notifications gives you ssl peer check failed error
This started happening out of the blue and my notifications stopped working on production (Im using AWS).
Adding ssl_verifypeer: false fixed the issue (or '-k' option in curl).
Not sure if you guys experienced this too, but here is my solution.
class TyphoeusNoSSLCheck
# @aryk - The push notifications just stopped out of nowhere because they expo servers changed something with their ssl
# certificates (I think) which caused the notifications to not get sent. After some debugging I used the "-k" option on curl
# or ssl_verifypeer: false option in this library. This is only required when the calls are made from AWS.
def self.post(*args)
options = args.last.is_a?(Hash) ? args.pop : {}
Typhoeus.post(*args, **options, ssl_verifypeer: false)
end
end
Sorry, but how is this used in your workflow? I'm doing something like
client = Exponent::Push::Client.new
...
...
client.send_messages messages
Is your code supposed to monkeypatch Typhoeus?
No monkey patching required:
def client
@client ||= Exponent::Push::Client.new(http_client: TyphoeusNoSSLCheck)
end
ah, lovely. Thank you!
@asanger FYI I made a fork that allows to easily add the nossl check without needing to pass in a class:
https://github.com/expo-community/expo-server-sdk-ruby/issues/43