Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Posting notifications gives you ssl peer check failed error #42

Open
Aryk opened this issue Oct 1, 2021 · 4 comments
Open

Posting notifications gives you ssl peer check failed error #42

Aryk opened this issue Oct 1, 2021 · 4 comments

Comments

@Aryk
Copy link

Aryk commented Oct 1, 2021

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
@asanger
Copy link

asanger commented Oct 12, 2021

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?

@Aryk
Copy link
Author

Aryk commented Oct 12, 2021

No monkey patching required:

     def client
        @client ||= Exponent::Push::Client.new(http_client: TyphoeusNoSSLCheck)
      end

@asanger
Copy link

asanger commented Oct 12, 2021

ah, lovely. Thank you!

@Aryk
Copy link
Author

Aryk commented Dec 9, 2021

@asanger FYI I made a fork that allows to easily add the nossl check without needing to pass in a class:

#43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants