In the Composer Options window we have ticked the "Automatically Authenticate" box. This does an automatic NTLM negotiation for HTTP requests to the upstream proxy, but fails to do the same when CONNECT'ing for the HTTPS target. Instead, CONNECT fails with a 407 return code. Fiddler just gives up at this point, while e.g. Google Chrome authenticates via NTLM with the upstream proxy (when going direct, without Fiddler) and then successfully CONNECTs.
To add more colour to what we're trying to avoid: We want to use this on 'end user's' machines, so the big plus of Auto-Auth is the user not having to enter their creds in plaintext somewhere.
If there's a way to get there with the below flow, that would be ideal.....
See below for the sanitised captures.
=== Same Request that I always send to Fiddler ===
GET /dis/ HTTP/1.1
Host: localhost
=== (1) Reverse proxying a HTTP target ===
--- Request #1 ---
HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
Via: 1.1 PROXYHOST
Proxy-Authenticate: Negotiate
Proxy-Authenticate: Kerberos
Proxy-Authenticate: NTLM
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Content-Length: 4119
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Error Message</TITLE>
... proxy error page ...
</HTML>
--- Request #2 ---
Proxy-Authorization: Negotiate BASE64FOO=====
HTTP/1.1 407 Proxy Authentication Required ( Access is denied. )
Via: 1.1 PROXYHOST
Proxy-Authenticate: Negotiate MOREBASE64FOO=====
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Content-Length: 0
--- Request #3 ---
Proxy-Authorization: Negotiate EVENMOREBASE64FOO=====
HTTP/1.1 301 Moved Permanently
Via: 1.1 PROXYHOST
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 178
Date: Mon, 21 Sep 2015 16:58:55 GMT
Content-Type: text/html
Server: nginx
<html>
... expected content from http target...
</html>
=== (2) Reverse proxying a HTTPS target ===
--- Request #1 ---
HTTP/1.1 502 Fiddler - Gateway Connection Failed
Date: Mon, 21 Sep 2015 17:05:54 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Cache-Control: no-cache, must-revalidate
Timestamp: 18:05:54.871
[Fiddler] The connection to the upstream proxy/gateway failed. Closing Fiddler, changing your system proxy settings, and restarting Fiddler may help. <br />System.Exception Upstream Gateway refused requested CONNECT.
--- What Wireshark sees for Request #1 ---
Connection: close
HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
Via: 1.1 PROXYHOST
Proxy-Authenticate: Negotiate
Proxy-Authenticate: Kerberos
Proxy-Authenticate: NTLM
Connection: close
Proxy-Connection: close
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Content-Length: 727
<HTML><HEAD><TITLE>Error Message</TITLE>
... proxy error page ...
</HTML>
=== (3) Reverse proxying a HTTPS target (again) ===
As above but after setting "prefs set fiddler.composer.HTTPSProxyBasicCreds user:pass" in QuickExec
--- Request #1 ---
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 21 Sep 2015 17:18:15 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
d
["v8","v8.0"]
0
--- What Wireshark sees for Request #1 ---
Proxy-Authorization: Basic ... is sent with the first CONNECT request, which means the CONNECT succeeds at the first attempt, no 407.