Calling target server using HTTPS,How do we set https for the target server?

Not applicable

I have the below configuration for the target end point

<HTTPTargetConnection>

<LoadBalancer>

<Algorithm>RoundRobin</Algorithm>

<Server name="Target-EndPoint-1"/>

<Server name="Target-EndPoint-2"/>

</LoadBalancer>

<Path>/test/path</Path>

</HTTPTargetConnection>

The Target Server was created as

curl {magmt url}/v1/o/{org_name}/e/{env_name}/targetservers -H "Content-Type:text/xml" -X POST -d \ '<TargetServer name="Target-EndPoint-1"> <Host>{host-name}</Host> <Port>8443</Port> <IsEnabled>true</IsEnabled> <SSLInfo> <Enabled>true</Enabled> <ClientAuthEnabled>true</ClientAuthEnabled> <KeyStore>{KeystoreName}</KeyStore> <KeyAlias>{KeyAlias}</KeyAlias> </SSLInfo> </TargetServer>' -v

When I access the service, from proxy the target is called using "http" - how do I make it to call via "https"?

Thanks in advance for the help.

Regards,

Pramod

Solved Solved
2 8 3,004
1 ACCEPTED SOLUTION

HI @Pramod - if you are looking at the trace UI, please treat that as a bug in the Trace UI. If you are getting valid response, you are good. We have a defect opened for this and once its fixed, will let you know. You can also refer to this link.

View solution in original post

8 REPLIES 8

@Pramod Your target endpoint should have something like this:

    <HTTPTargetConnection>
        <Properties/>
        <SSLInfo>
            <Enabled>true</Enabled>
        </SSLInfo>
        <LoadBalancer>
            <Server name="micro-service-server"/>
        </LoadBalancer>
        <Path>/xx/yy/zz</Path>
    </HTTPTargetConnection>

Thank you @Sunandita Dam. I tried that earlier, sorry that I missed to put in the post, but still it shows that it is using the http protocol.

Below is the trace o/p:

Request sent to target server

POST http://<host-name>/<path-value>;

HI @Pramod - if you are looking at the trace UI, please treat that as a bug in the Trace UI. If you are getting valid response, you are good. We have a defect opened for this and once its fixed, will let you know. You can also refer to this link.

Thank you @Sai Saran Vaidyanathan for the details! Yes, I am getting response. So I assume it is only the issue in trace UI. Appreciate the quick responses!

@Pramod

Yeah - thats the case I believe. If this answers, please accept for others to use

So when is this planned to be fixed as we are seeing this in our Apigee trace on our production service?

@Pramod @Sai Saran Vaidyanathan

It's not UI issue. I came across similar issue and my target was responding differently over https than http. When apigee hits backend I do see in trace that It's using http and getting response same as how it should respond on http and not https. I am sure that It's not trace UI issue.

The solution for this is not to create target server using UI. Through UI apigee does not have all the option as we can create target server through maven. I used below configuration to create target server and It's making call to target as https. It's working fine.

{ "name" : "{target}", "host" : "{hostname}", "isEnabled" : {true | false}, "port" : {port_num}, "sSLInfo": { "enabled": "true | false", "clientAuthEnabled": "true | false", "keyStore": "{keystore_name}", "trustStore": "{truststore_name}", "keyAlias": "{key_alias}", "ignoreValidationErrors": "true | false", "ciphers": [ "{cipher_1}", "{cipher_2}", ... ], "protocols": [ "{protocol_1}", "{protocol_2}", ...] } }

Note: If I create target server through UI and give SSL info in the target endpoint, It's not working and making call as http.

@Chirag Patel - the trace UI shows http even though the call is https. It is a Trace UI bug. Please check if the SSL info is enabled in the target server you configured (via the Mgmt API) and hope the port is not pointing to 80