# EventSub Challenge Not Reaching My Server

**URL:** <https://discuss.dev.twitch.com/t/eventsub-challenge-not-reaching-my-server/57343>\
**Category:** API\
**Created:** [March 27, 2024, 4:39pm UTC](https://discuss.dev.twitch.com/t/eventsub-challenge-not-reaching-my-server/57343 "2024-03-27T16:39:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheCowness](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@TheCowness](https://discuss.dev.twitch.com/u/TheCowness)\
**Post date:** [March 27, 2024, 4:39pm UTC](https://discuss.dev.twitch.com/t/eventsub-challenge-not-reaching-my-server/57343/1 "2024-03-27T16:39:26Z")

</div>

Hello,

I’m trying to figure out how to get Twitch to send my web server notices when someone redeems channel points. I’ve got to the point where the eventsub/subscriptions endpoint is returning JSON containing a status of webhook\_callback\_verification\_pending, and I can see the subscription attempt if I poll all of my subscriptions, but after a few minutes the status changes to webhook\_callback\_verification\_failed. In this time, I see no record of Twitch hitting my server. If I click the URL in the “callback” field of Twitch’s response JSON, my browser opens the callback page successfully, so they’ve got the right URL.

My callback URL is a PHP script that logs all requests to a file, and then if it recognizes an EventSub challenge request, it responds as outlined in the API documentation. The PHP script’s logging and Apache’s logging both show no evidence that anyone other than myself has accessed the script. The web site in general has traffic from other sources, but not specifically the callback script.

```auto
//My PHP code
$raw_request = file_get_contents('php://input');
$decoded_request = json_decode($raw_request);
if($decoded_request != null){
	if(isset($decoded_request->challenge)){
		//API doc text says to use this header, unsure why the length would go in content-type and not content length...
		header('Content-Type: '.strlen($decoded_request->challenge));
		//JS example in the API doc uses text/plain instead, which makes more sense.
		//header('Content-Type: text/plain');
		echo $decoded_request->challenge;
	}
}

```

I’ve called my own script from PostMan using the sample challenge request provided in the API documentation, and confirmed it returns a 200 status code, Content-Type is either “32” or “text/plain” depending on which of the conflicting instructions I follow, and the body contains only the sample challenge. The server does use HTTPS and is fully open to the public on a registered DNS host name ([https://cowness.net](https://cowness.net)), encrypted with a Let’s Encrypt cert.

Anyone have any ideas? I saw another thread where the first response was asking about the SSL cert used; could Twitch not like Let’s Encrypt?

Thanks.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [March 27, 2024, 4:40pm UTC](https://discuss.dev.twitch.com/t/eventsub-challenge-not-reaching-my-server/57343/2 "2024-03-27T16:40:35Z")

</div>

1. Check [SSL Server Test (Powered by Qualys SSL Labs)](https://www.ssllabs.com/ssltest/analyze.html) for your SSL configuration to be valid
2. Check if you have cloudflare or other firewall software blocking
3. Check that your code doesn’t hit a URL and redirect to another location as it won’t follow redirects

I use LE so it’s not a LE issue. Most liekly a configuration or firewall. (the latter more likely)

---

<div class="post-metadata">

**Author:** ![TheCowness](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@TheCowness](https://discuss.dev.twitch.com/u/TheCowness)\
**Post date:** [March 27, 2024, 5:03pm UTC](https://discuss.dev.twitch.com/t/eventsub-challenge-not-reaching-my-server/57343/3 "2024-03-27T17:03:52Z")

</div>

That site gives me a B rating, citing an incomplete chain, not sure if Twitch would care about that. But it supports TLS 1.3, “Certificate” bar is at 100, “Cipher Strength” is 90.

There isn’t anything complicated like software firewalls or Cloudflare involved. Just my router and ISP, but I haven’t had any issues with my ISP blocking anything.

There shouldn’t be any redirects. I’m linking directly to a PHP script, and in Postman I’m getting a 200 status, not a 302.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [March 27, 2024, 5:04pm UTC](https://discuss.dev.twitch.com/t/eventsub-challenge-not-reaching-my-server/57343/4 "2024-03-27T17:04:29Z")

</div>

> [@TheCowness](#):
>
> That site gives me a B rating, citing an incomplete chain, not sure if Twitch would care about that

That would be the issue.

You should have a fullchain file that contains usually 3 certificates.  
You should be using that.

Browsers are more “lax” but you should be using a fullchain

---

<div class="post-metadata">

**Author:** ![TheCowness](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@TheCowness](https://discuss.dev.twitch.com/u/TheCowness)\
**Post date:** [March 27, 2024, 6:00pm UTC](https://discuss.dev.twitch.com/t/eventsub-challenge-not-reaching-my-server/57343/5 "2024-03-27T18:00:45Z")

</div>

That fixed it, thanks. I had Apache using the LE cert.pem instead of fullchain.pem for the cert chain file. Changed that, restarted Apache, and now I’m looking at “Status: Enabled” on my event sub. Cool.

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [April 26, 2024, 6:01pm UTC](https://discuss.dev.twitch.com/t/eventsub-challenge-not-reaching-my-server/57343/6 "2024-04-26T18:01:20Z")

</div>

Closed on April 26, 2024, 6:01pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
