When I use a target server for a secure connection API call, I get the following error:
502 Bad Gateway { "fault": { "faultstring": "Unexpected EOF", "detail": { "errorcode": "messaging.adaptors.http.UnexpectedEOF" } } }
The target server looks something like this:
{ "host": "www.somehost.com", "isEnabled": true, "name": "https_target", "port": 443 }
Under the following scenarios the API works fine:
1. Create an API Proxy which has the target URL as "https://www.somehost.com"
2. API Proxy enabled for Non-secure connection with the target server
3. Execute curl API with URL pointing directly to the target/backend server
Can someone tell me if I am missing something in setting up the target server or anything else ?
Note: www.somehost.com is just a dummy name used to explain the problem. The actual host name is different.
Solved! Go to Solution.
If target server is secure, we have to explicitly set the SSL enabled flag to true, irrespective of 1-way or 2-way SSL. Sample has been added.
<TargetServer name="TargetServer1"> <IsEnabled>true</IsEnabled> <Host>www.somehost.com</Host> <Port>443</Port> <SSLInfo> <Enabled>true</Enabled> </SSLInfo> </TargetServer>