I am running a Flask API application, and I have an SSL Certificate. When I run flask server on localhost the certificate is applied from Flask successfully.
But when I use Ngrok to deploy the localhost on a custom domain, the certificate is changed to *.ngrok.com, how can I change that to my certificate?.
EDIT #1: I already have a certificate for the new hostname and I have already applied it on Flask, but ngrok is changing it.
From the description on the ngrok docs, all TLS connections are terminated by ngrok. So, if you want to terminate your own TLS connections then you have to setup a custom domain as explained here, so that the domain matches the certificate. You can see more details on TLS tunnels part of the docs.