[英]HTTPS proxy server python
I have a problem with my ssl server (in Python).我的 ssl 服务器(在 Python 中)有问题。 I set the SSL proxy connection in my browser, and try to connect to my ssl server.
我在浏览器中设置了 SSL 代理连接,并尝试连接到我的 ssl 服务器。
This is the server:这是服务器:
import BaseHTTPServer, SimpleHTTPServer
import ssl
httpd = BaseHTTPServer.HTTPServer(('0.0.0.0', 443), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, server_side=True, certfile='server.crt', keyfile='server.key', do_handshake_on_connect=False)
httpd.serve_forever()
This is the error:这是错误:
SSLError: [SSL: HTTPS_PROXY_REQUEST] https proxy request (_ssl.c:1750)
I try to connect to the server in the browser.我尝试在浏览器中连接到服务器。 its work if I went to address " https://127.0.0.1:443 ".
如果我去地址“ https://127.0.0.1:443 ”,它的工作。 But, if I use in the server to proxy, I get the error...
但是,如果我在服务器中使用代理,则会出现错误...
How can I fix this?我怎样才能解决这个问题?
I don't think you understand how a proxy server for HTTPS works.我认为您不了解 HTTPS 代理服务器的工作原理。
What you are doing is to create a plain HTTPS server.您正在做的是创建一个普通的 HTTPS 服务器。 What you should do is to create a HTTP server which handles the CONNECT request and creates a tunnel to the requested target.
您应该做的是创建一个 HTTP 服务器来处理 CONNECT 请求并创建到请求目标的隧道。 Seehttp://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_tunneling
见http://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_tunneling
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.