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

后端 未结 4 1567
死守一世寂寞
死守一世寂寞 2020-12-08 03:33

I am writing an HTTP proxy and I am having trouble understanding some details of making a CONNECT request over TLS. To get a better picture, I am experimenting with Apache

4条回答
  •  有刺的猬
    2020-12-08 03:56

    From RFC 2616 (section 14.23):

    The Host request-header field specifies the Internet host and port number of the resource being requested, as obtained from the original URI given by the user or referring resource (generally an HTTP URL, as described in section 3.2.2). The Host field value MUST represent the naming authority of the origin server or gateway given by the original URL.

    My understanding is that you need to copy the address from CONNECT line to HOST line. All in all, the address of the resource is 192.168.1.1, and the fact that you are connecting via example.com doesn't change anything from RFC point of view.

提交回复
热议问题