monkeyWie / proxyee

HTTP proxy server,support HTTPS&websocket.MITM impl,intercept and tamper HTTPS traffic.
MIT License
1.52k stars 572 forks source link

现在netty的client hello协议指纹已经被阿里云盾收录,一旦用户开启云盾将无法使用默认配置请求,希望加上可自定义设置ciphers的函数 #205

Closed xyzj91 closed 2 years ago

xyzj91 commented 2 years ago

在HttpProxyServerConfig.java中加上

private Iterable<String> ciphers;
 public Iterable<String> getCiphers() {
        return ciphers;
    }
   public void setCiphers(Iterable<String> ciphers) {
        this.ciphers = ciphers;
    }

在HttpProxyServer.java中修改init函数

SslContextBuilder contextBuilder = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE);
                // 设置ciphers用于改变 client hello 握手协议指纹
                if(serverConfig.getCiphers()!=null){
                    contextBuilder.ciphers(serverConfig.getCiphers());
                }
                serverConfig.setClientSslCtx(
                        contextBuilder.build());

这样调整之后在启动代理前设置好ciphers就可以突破阿里云盾的请求限制了,否则一旦开启阿里云盾,请求会响应504 很抱歉,由于您访问的URL有可能对网站造成安全威胁,您的访问被阻断。

monkeyWie commented 2 years ago

你可以帮忙提个pr吗

xyzj91 commented 2 years ago

刚刚提交了一个pr,你看看没问题就合并下

monkeyWie commented 2 years ago

@xyzj91 感谢,已经合并了