1

I have a service wrapping an external API. When deploying to our test IIS7 servers I need to have the application pool run as a domain account with proxy permissions, if I don't then I get the following exception:

System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it [IP Address]

The IP address that 'actively refused' the connection is actually the target of the request, which I find confusing - if the application pool identity can't get through the proxy then how has the target machine refused the request?

I have the following block in web.config:

<system.net>
    <defaultProxy enabled="true" useDefaultCredentials="true"</defaultProxy>
</system.net>
Matt Rowett
  • 266
  • 1
  • 18
  • Log on to the machine using the pool identity and configure its proxy settings to the desired state. It is not something automatic. – Lex Li Jul 02 '15 at 14:44
  • I know how to get this working, it's the error that I'm questioning. – Matt Rowett Jul 02 '15 at 18:47
  • The error message is also desired, as without a proper proxy the TCP SYN packet never meets an ACK from the server. That message just means this for all cases alike. – Lex Li Jul 03 '15 at 00:43
  • Do you not think the error is misleading? If the request can't get past the proxy you would not expect an IP resolved from the hostname I provided. It implies that the request reached the target when in really it didn't go past the proxy? – Matt Rowett Jul 03 '15 at 08:34

0 Answers0