在 C# 代理服务器中构建 HTTPS 支持
我正在用 C# 构建一个代理服务器,我试图弄清楚如何支持 HTTPS 请求,并阅读它们。您能否推荐一些文章、教程或开源项目,让我可以了解有关如何实现此功能的更多信息?
I am building a proxy server in C# and I am trying to figure out how to support HTTPS requests, and read through them. Can you suggest any articles, tutorials, or open source projects where I can learn more on how to implement this feature?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果“通读它们”的意思是“解密请求的内容”,那么答案是“你不能”。您所描述的是所谓的“中间人攻击”(MITM)。显然,SSL 受到了保护。
现在,如果您可以使用代理(某种企业环境,或者您正在创建 Fiddler 的竞争对手)控制客户端,则可以通过让客户端信任您的证书来破坏 SSL,然后使用标准 .NET 加密实现 MITM蜜蜂。
附言。有关此方法的优秀示例,请查看带有 Reflector 的 Fiddler。 :)
If by "read through them" you mean "decrypt the contents of the request", the answer is "You can't". What you describe is a so called "man in the middle attack" (MITM). Obviously, SSL is protected from this.
Now, if you have control over the clients using your proxy (some kind of enterprise environment, or you are creating a competitor to Fiddler), you can subvert SSL by making clients trust your certificates, and then implement your MITM using standard .NET crypto APIs.
PS. For an exellent example of this approach, look at Fiddler with Reflector. :)