I've configured an On-Premises Data Gateway and a Custom Connector to use only HTTP API endpoints, but I receive this error message when testing:
{
"message": "Received error payload from gateway service with ID 3091244: Substituted: HttpRequestException:<pi>System.Net.Http.HttpRequestException: An error occurred while sending the
request. ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. --->
System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure
...
},
"source": "gatewayconnector-eus.azconn-eus-002.p.azurewebsites.net"
}
I have validated the On-Premises Data Gateway is online and ready for use.
I'm certain that my API is configured for HTTP traffic only and that the Connector is making HTTP calls.
Requests to the API work as expected.
What am I missing / where else should I be looking? I'm at a total loss.
Ok, perhaps this will prevent some other unfortunate developer loads of wasted time... turns out that the whole issue was due to a rogue HTTP > HTTPS redirect being initiated from my API.
It was difficult to track down because the redirect did not occur when the request was issued from Postman. But after reviewing the Gateway's QueryExecutionReport log, I was able to confirm that traffic was making its way to my On-Premises Gateway and being relayed correctly to my API. Testing from a browser on the same server my Gateway resides on led me to the redirect... and since my test API doesn't have a valid certificate, voila. Crash & burn.
The quick / easy fix was to configure the API to not perform HTTP > HTTPS redirects.