The above is working fine for non-SSL requests by excluding withManInTheMiddle(as ChainedProxyManager and withManInTheMiddle are mutually exclusive) while creating proxy like:
this.proxyServer = DefaultHttpProxyServer.bootstrap()
.withName("Downstream")
.withPort(downstreamProxyPort)
.withChainProxyManager(chainedProxyManager(upstreamProxyHostName, upstreamProxyPort))
/*.withManInTheMiddle(new SelfSignedMitmManager()) */
.withFiltersSource(new HttpFiltersSourceAdapter() {
public HttpFilters filterRequest(HttpRequest originalRequest, ChannelHandlerContext ctx) {
customHttpFilter = new CustomHttpFiltersAdapter(originalRequest);
if (modifyRequest)
customHttpFilter.setModifyRequest(true);
else
customHttpFilter.setModifyRequest(false);
return customHttpFilter;
}
})
.start();
My use case also involves SSL traffic for chained proxy. Is there any way to achieve this? Any work arounds?