Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Webhook is not reaching to endpoint

Webhook is not reaching to endpoint

anilbhargava777
Visitor
3 0 0

I started an EC2 instance and deployed some sample java code for it which listens for the upcoming HTTP and HTTPS requests on port 8080 and 8443 respectively. I tested the app using the REST client and it prints the request details on the console. Right now facing issue in listening to upcoming requests, when I put my endpoint URL in Shopify webhook registration and generating events. Shopify events webhooks are getting received on the mock Beeceptor endpoint and when I copy the same request headers and body and make the request from REST client to my app then it prints the whole thing. I think there is some issue with Shopify config. As per the docs either it is looking for valid CA certs in the app or it is trying to hit the default secure port 443 which can't be open by an AWS user.

Replies 5 (5)

Alex
Shopify Staff
1561 81 343

Specifying a port should work under basic circumstances. If I set my webhook port to 8080, and I test that webhook, I can see the webhook request pointing to that specific port when it fires in logs.

 

Can you share with me a webhook subscription ID and a time frame in which you expected this to work? I can check logs for that and perhaps get a clearer picture of what might be happening. Let me know if I'm misunderstanding your issue of course.

 

Cheers.

Alex | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

anilbhargava777
Visitor
3 0 0

I have created the webhook from the admin panel so, I don't have the subscription ID with me. Using the admin panel send a test notification to test my endpoints. Right now having two webhooks registered for product creation having different endpoint URLs. One is sending the callback to the online mock endpoint on the Beeceptor and another one is sending to my app running on EC2 instance. I have tried again today within the timeframe of 1:30 PM to 1:45 PM IST (Indian Standard Time). Let me know if you need anything else.

Screenshot (2)_LI.jpg

 

Alex
Shopify Staff
1561 81 343

Looking at logs, it seems like your server makes use of a self signed certificate, which is raising an error in our logs. My assumption is we don't like this because we don't want to risk something like a man-in-the-middle attack. Is the self signed cert something you're aware of?

 

Cheers.

Alex | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

anilbhargava777
Visitor
3 0 0

Yes, I am using the self-signed certificates on my app. I am preparing some demo for Shopify webhooks so I had to use it as Shopify only allow HTTPS endpoint. Is there any place where I can get a valid mock CA certificate for free for my development purpose?

Alex
Shopify Staff
1561 81 343

I believe LetsEncrypt offers authority-signed certificates free: https://letsencrypt.org/ - I'm not the expert in SSL certs but does that suit your needs?

 

Cheers.

Alex | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog