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

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).

主站蜘蛛池模板: 孟津县| 修武县| 宜兰县| 宜兰县| 横山县| 额尔古纳市| 府谷县| 莎车县| 栾川县| 丰台区| 巴彦淖尔市| 同德县| 特克斯县| 正阳县| 绥化市| 新河县| 资中县| 磐石市| 大宁县| 江安县| 津南区| 益阳市| 石屏县| 龙海市| 深泽县| 临朐县| 兴文县| 南华县| 基隆市| 宝清县| 安化县| 丰城市| 延寿县| 盐边县| 伊宁市| 洛隆县| 贡山| 景谷| 六盘水市| 南木林县| 鲁甸县|