官术网_书友最值得收藏!

Case 2 – with a proxy 

When we make the request with a proxy, the browser only connects to the proxy and not the actual website. So, the difference in the commands is as follows: 

telnet <Proxy IP> <Proxy Port> 
GET http://www.google.com/ HTTP/1.1
Host: www.google.com
Connection: Close

As we can see, instead of sending only the / as a parameter to the GET, we send the full URL, so that the proxy server can make the request on our behalf. 

This will work for HTTP (unencrypted), however for HTTPS the telnet utility shouldn't be used for testing, the openssl command should be used. 

A sample of the HTTPS connection is shown as follows (provided openssl is installed on your terminal). 

We will use the s_client or the secure client in the OpenSSL library. The command is shown as follows (used instead of telnet <ip> <port> shown in the preceding example):
openssl s_client -connect www.google.com:443.

This will then establish a secure channel to the server (by agreeing on the cipher, verifying the certificate, and changing the cipher spec). Once it is done, you can continue to use the HTTP commands as before (GET, Host, Connection, and so on).

主站蜘蛛池模板: 长垣县| 漠河县| 武宣县| 招远市| 阿拉善右旗| 左云县| 双牌县| 永寿县| 霞浦县| 兴海县| 兴义市| 务川| 怀仁县| 潢川县| 胶州市| 册亨县| 永德县| 天全县| 九寨沟县| 呼玛县| 抚顺县| 故城县| 肃南| 河西区| 天峻县| 年辖:市辖区| 新和县| 新巴尔虎右旗| 克东县| 灵武市| 唐河县| 抚顺市| 卓尼县| 南投县| 长垣县| 永昌县| 新建县| 安图县| 永胜县| 冀州市| 兴宁市|