I spent hours trying to figure out why my Stripe webhook was failing and had to piece together little bits of internet comments to figure it out. So if you're coming across the same error, hopefully this will help.
I was setting up Stripe webhooks so that when someone bought a Disco product, it would ping my server and my app could save that information to the database as a new user and a new order and then send the user a welcome email. Everything worked well on local and I pushed it live. However, when it was live, I kept getting this very unhelpful error:
I knew it wasn't my code that was the problem, given that the error wasn't a 500 or other error that would indicate issues with my app. I didn't know what a TLS error was, but I know that TLS doesn't have to do with my code.
Long story short, the issue ended up having to do with how my SSL certs were set up. I used this site to analyze my SSL configuration and it told me that there was a problem with my certificate chain.
To fix it, I had to go to my hosting provider. I was using Heroku, so I looked up fixing SSL issues on Heroku and after doing some more searching, I found out that instead of letting Heroku manage my certs, I was doing it myself. So I updated my certs to have Heroku manage it.
To do that, I ran the following command:
heroku certs:auto:enable --app [APP NAME]
Once I ran that command, I resent the Stripe hook and everything worked. Woohoo!
So if you see that error and you're not sure what to do, check your SSL configuration and maybe don't manage it yourself.
Top comments (0)