Score:0

Setting up a secure proxy on IIS 10 for HTTPS tunneling

us flag

I am trying to set up an IIS 10 (Windows 2019) to tunnel HTTPS traffic to a REST API of an application server at our customer location.

Tunnelling HTTP traffic was no problem and works like it should via the rule in web.config:

        <rule name="ReverseProxyInboundRule1" enabled="true" stopProcessing="true">
            <match url="(.*)" />
            <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
            <action type="Rewrite" 
                    url="https://10.10.105.194/{R:1}" 
                    appendQueryString="false" logRewrittenUrl="true" />
        </rule>

The Proxy uses a certificate from our internal CA, HTTPS access via Internet Explorer and Chrome works without any warnings as the root CA certificate and certificate have been imported into the certificate store.

Another certificate issued by the same CA has been set up on the application server, the certificate and root CA certificate have been added to the certificate store of the proxy server and the proxy server is able to access the REST API via IE and Chrome without a certificate warning over HTTPS.

When accessing the REST API via proxy, the proxy will return:

HTTP Error 502.3 - Bad Gateway

A security error occurred

Traffic caught via WireShark looks good, the proxy and application server seem to me to do a proper handshake.

Wireshark log

I checked that the request is valid and returns JSON, I even hardcoded the Rewrite URL to make sure it's not related to parameters.

Any pointers where I could find more information about the underlying cause?

Lex Li avatar
vn flag
Can you enable FRT to learn more about that 502.3 error? https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.