How can we make https calls to another proxy using Proxy chaining feature ?

I have gone through the documentation about proxy chaining feature at Consuming one proxy from another proxy. It talks about making http calls. I have proxies that accept only secure (https) calls. Can I know how to make a https call to the second Proxy from the first proxy using the proxy chaining feature ? Do I need to any additional flags or can I do it as we make http calls ?

If any example can be shared, it will be useful.

0 7 1,014
7 REPLIES 7

@Peter Johnson, @arghya das,

Any help on this question would be much appreciated.

Thanks,

Amar

Not applicable

You don't need to do anything different to invoke your proxy.

In fact as the second proxy is invoked on the same server as the first proxy. There is no network hop from the first to the second proxy.

When the second proxy is invoked from the first with a local target, it is invoked with localhost using HTTP rather than HTTPS. The second proxy checks the protocol and will then generate an error since the request is not HTTPS.

So, apparently something different is needed to invoke the second local proxy with HTTPS. For an HTTP connection target this is not a problem because the protocol is part of the URL, but that is a slower connection than a local target.

Not applicable

When you say "The second proxy checks the protocol" ? How is that done?

<Step>
    <Name>fault_require_https</Name>
    <Condition>(client.scheme != "https")</Condition>
</Step>



Apparently client.scheme is not set correctly when proxy chaining via localhost occurs. Checking the x-forwarded-proto request header works correctly instead.

I had suggested @George Shaw to use header X-forwarded-Proto (which contains the protocol) in the conditional flow, instead of client.scheme. He confirmed that using X-forwarded-Proto works.