{"action":"created","issue":{"url":"https://api.github.com/repos/XX-net/XX-Net/issues/502","labels_url":"https://api.github.com/repos/XX-net/XX-Net/issues/502/labels{/name}","comments_url":"https://api.github.com/repos/XX-net/XX-Net/issues/502/comments","events_url":"https://api.github.com/repos/XX-net/XX-Net/issues/502/events","html_url":"https://github.com/XX-net/XX-Net/pull/502","id":86057674,"number":502,"title":"(have bug,need help)To support gvs ip,add ECDHE... ciphers to ssl_sock generated by ssl module or OpenSSL module","user":{"login":"linhua55","id":6326116,"avatar_url":"https://avatars.githubusercontent.com/u/6326116?v=3","gravatar_id":"","url":"https://api.github.com/users/linhua55","html_url":"https://github.com/linhua55","followers_url":"https://api.github.com/users/linhua55/followers","following_url":"https://api.github.com/users/linhua55/following{/other_user}","gists_url":"https://api.github.com/users/linhua55/gists{/gist_id}","starred_url":"https://api.github.com/users/linhua55/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linhua55/subscriptions","organizations_url":"https://api.github.com/users/linhua55/orgs","repos_url":"https://api.github.com/users/linhua55/repos","events_url":"https://api.github.com/users/linhua55/events{/privacy}","received_events_url":"https://api.github.com/users/linhua55/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-08T07:09:41Z","updated_at":"2015-06-08T12:06:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/XX-net/XX-Net/pulls/502","html_url":"https://github.com/XX-net/XX-Net/pull/502","diff_url":"https://github.com/XX-net/XX-Net/pull/502.diff","patch_url":"https://github.com/XX-net/XX-Net/pull/502.patch"},"body":"因为ssl_sock是由ssl模块或者OpenSSL模块建立的，所以搜索了一下，在适当的位置添加指定的ciphers。\r\nssl模块创建ssl_sock是由ssl.wrap_socket实现的，直接添加在此函数的参数中，\r\n而OpenSSL模块创建ssl_sock，则灵活（复杂）一点，先创建SSLContext，再用OpenSSL.SSL.Connection函数把SSLContext和socket合并起来。需要在SSLContext的创建过程中，用Context.set_cipher_list（ssl_context.set_cipher_list）函数指定ciphers。\r\n测试结果：\r\n1、可以正确添加gvs ip到good_ip.txt中，在good_ip.txt中显示为gws\r\n2、用python2 start.py命令刚打开时，可以正常工作。但过一会就不断打印“warning no gws ip”警告，并且不能继续访问。好像是这些ip只能完成一次连接就被程序弃用了。具体原因未知。\r\n\r\n调试时，把good_ip.txt,bad_ip2.txt删掉，ip_range.txt换成自己找到的gvs ips\r\n\r\n# 需要帮助呀！！！"},"comment":{"url":"https://api.github.com/repos/XX-net/XX-Net/issues/comments/109969685","html_url":"https://github.com/XX-net/XX-Net/pull/502#issuecomment-109969685","issue_url":"https://api.github.com/repos/XX-net/XX-Net/issues/502","id":109969685,"user":{"login":"xxnet","id":10395528,"avatar_url":"https://avatars.githubusercontent.com/u/10395528?v=3","gravatar_id":"","url":"https://api.github.com/users/xxnet","html_url":"https://github.com/xxnet","followers_url":"https://api.github.com/users/xxnet/followers","following_url":"https://api.github.com/users/xxnet/following{/other_user}","gists_url":"https://api.github.com/users/xxnet/gists{/gist_id}","starred_url":"https://api.github.com/users/xxnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xxnet/subscriptions","organizations_url":"https://api.github.com/users/xxnet/orgs","repos_url":"https://api.github.com/users/xxnet/repos","events_url":"https://api.github.com/users/xxnet/events{/privacy}","received_events_url":"https://api.github.com/users/xxnet/received_events","type":"User","site_admin":false},"created_at":"2015-06-08T12:06:47Z","updated_at":"2015-06-08T12:06:47Z","body":"刚才测试了，发现很快就能找到很多快速的ip，非常好用。\r\n\r\n不过保守考虑，在高级设置里放一个开关，防止被封了之后无法使用好。\r\n智能的方案是，原来是gws的ip，还是照样用全部cipher，只有gvs，才选用特定的chiper。\r\n\r\n更好的方案，还是能够有更多cipher，难道只能这个cipher才能切换到gws吗？\r\n可以把所有支持的cipher，逐个测试看哪些能够让gvs切换成gws。\r\n\r\n可以发一个测试版，让用户试试反馈。"}}