Reputation: 885
Environment- Established the connection between Azure App Service and OnPrem Network and vrified the connection.
Requirement - There is API hosted in OnPrem and with DNS name and HTTPS enabled (https://test.com/GetData)
But OnPrem API cannot be accessible from Azure API using DNS name and getting error like Hostname cannot be found.
But When I mention the Onprem API IP address (https://12.34.34.3/GetData), it seems communication established but ssl error - The SSL connection could not be established.
What would be the best solution here.
Regards
Abdul
Upvotes: 0
Views: 290
Reputation: 885
When an app hosted on Azure App Service and tries to connect to a remote endpoint over SSL, it is important that the certificate on the remote endpoint service is issued by a Trusted Root CA. If the certificate on the remote service is a self-signed certificate or a private CA certificate, it will not be trusted by the instance hosting your app and the SSL handshake will fail with this error.
Possible solutions are:
1: Remote endpoint service must use a certificate issued by Trusted Root CA.
2: Host the application on App Service Environment (ASE) where you can upload your internal CA root certificate and use WEBSITE_LOAD_ROOT_CERTIFICATES appsetting to load it into Trusted Root store.
Upvotes: 0
Reputation: 1743
Reason for "Hostname not found error" is the custom domain is not mapped to the Azure App service properly. Please go to "Custom Domains" and check if the custom domain is added or not. If not added, please follow the below procedure to add custom domain :
After adding the custom domain, the custom domain is still unsecure. You need to add the SSL certificate.
To add SSL certificate, please follow below procedure :
Now, you can access API using your custom domain which is secured.
Upvotes: 1