Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Fiddler adds connection:close on CONNECT response?

I noted that fiddler sends "connection:close" header when the client sends a CONNECT request to initiate secure connection along with the "200 connection established" message.

CONNECT request to a forward HTTP proxy over an SSL connection?

As explained in above question, the connection should be kept-alive between the client and the proxy so that the client can subsequently sent the actual request.

Why does fiddler sends the close header? wouldn't the client close the connection because of the header instead?.

enter image description hereenter image description here

like image 852
justanaccount121 Avatar asked Apr 05 '14 00:04

justanaccount121


2 Answers

Any Connection header in the successful response to the CONNECT request does not make any sense and gets ignored. CONNECT will establish a tunnel, which only ends with the end of the TCP connection. But a Connection header would make sense with an unsuccessful CONNECT, because with close the client would need to start a new TCP connection and with keep-alive (implicit with HTTP/1.1 response) it can reuse it with another request.

like image 101
Steffen Ullrich Avatar answered Oct 16 '22 12:10

Steffen Ullrich


Connection: Close means that the connection will be closed after the request completes. Since the request in this scenario only completes when the HTTPS connection is closed, this is exactly the behavior you want for this sort of request.

Arguably, using Connection: keep-alive on a CONNECT request is invalid, since there's no legal way for the connection to be kept-alive after the tunnel is closed.

like image 1
EricLaw Avatar answered Oct 16 '22 12:10

EricLaw