Weird https errors in flask app

Hello

I have an app with an Oauth flow in my Flask app. It requires a https redirects to work. However https is not working in my app. I am logging the request url and it is definitely a https request from the client end.

2022-11-26T08:32:01Z app[c2d707c0] ord [info]INFO:root:https://tpw-fam.chapra.co/login-callback/

However I am getting this error:

oauthlib.oauth2.rfc6749.errors.InsecureTransportError: (insecure_transport) OAuth 2 MUST utilize https.

I can’t find a similar error in my searches.

my fly.toml

app = "tpw-fam-app"
kill_signal = "SIGINT"
kill_timeout = 5

[env]

[experimental]
  allowed_public_ports = []
  auto_rollback = true
  entrypoint = []
  exec = []
  private_network = true

[build]
  dockerfile = "Dockerfile.publish"

[[services]]
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

  [[services.http_checks]]
    interval = 10000
    grace_period = "5s"
    method = "get"
    path = "/healthcheck"
    protocol = "http"
    restart_limit = 0
    timeout = 2000
    tls_skip_verify = false

I can’t even name the issue.

Hi @muddi900, on the off chance this is relevant to you: redirect_uri is http instead of https

I am not using flask-dance, but I did add the proxy list to my app. However now the app is not deploying at all.

v143 is being deployed
232b495f: ord pending
232b495f: ord pending
232b495f: ord running unhealthy [health checks: 2 total, 1 passing]
232b495f: ord running unhealthy [health checks: 2 total, 1 passing, 1 critical]
Failed Instances

Instance
Failure #1
ID      	PROCESS	VERSION	REGION	DESIRED	STATUS 	HEALTH CHECKS                 	RESTARTS	CREATED   

232b495f	app    	143    	ord   	run    	running	2 total, 1 passing, 1 critical	0       	4m56s ago	

Recent Events
TIMESTAMP           	TYPE      	MESSAGE                 
--> v143 failed - Failed due to unhealthy allocations - not rolling back to stable job version 143 as current job has same specification and deploying as v144 

I tried editing the healthcheck section of my fly.toml.

 [[services.http_checks]]
    interval = 10000
    grace_period = "5s"
    method = "get"
    path = "/healthcheck"
    protocol = "https"
    restart_limit = 0
    timeout = 2000
    tls_skip_verify = false

So is there a way to resolve this?