jxw
jxw

Reputation: 711

Receiving webhook over https in django development server tunneled using ngrok

I need to test a payment integration, where the payment service sends a webhook when payment is successful. The url for the webhook must be https://xxx-ngrock.io/paymentNotification. In this case, I cannot change the url to http. My problem is, I cannot receive this webhook because:

  1. In development mode django does not allow traffic over https only over http

  2. I tunnel to my development server using this command ./ngrok http https://localhost:8000 which I guess should forward the https traffic, but I have no way of testing it since the development server does not accept traffic over http in the first place.

Additional comments. Currently the ngrok forwarding map where both traffic from http and https are mapped to the https internal traffic that Django does not support for its development serveer.

ngrok by @inconshreveable                                                                                               (Ctrl+C to quit)
                                                                                                                                        
Session Status                online                                                                                                    
Account                       JianDk (Plan: Free)                                                                                       
Version                       2.3.40                                                                                                    
Region                        United States (us)                                                                                        
Web Interface                 http://127.0.0.1:4040                                                                                     
Forwarding                    http://3304-94-147-65-45.ngrok.io -> https://localhost:8000                                               
Forwarding                    https://3304-94-147-65-45.ngrok.io -> https://localhost:8000                                              
                                                                                                                                        
Connections                   ttl     opn     rt1     rt5     p50     p90                                                               
                              7       0       0.06    0.02    0.00    0.01                                                              
                                                                                                                                        
HTTP Requests                                                                                                                           
-------------                                                                                                                           
                                                                                                                                        
GET /favicon.ico                                                                                                                        
GET /                                                                                                                                   
GET /favicon.ico                                                                                                                        
GET /                                                                                                                                   
GET /                                                                                                                                   
GET /favicon.ico                                                                                                                        
GET /                                                                 

Upvotes: 0

Views: 357

Answers (1)

emanuel sanga
emanuel sanga

Reputation: 945

ngrok will provide one http and one https links for you to tunnel your dev server to.

So tou should use the one with https

If I have misunderstood your question, please add a comment!

Upvotes: 0

Related Questions