Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

由于使用本地 DNS 解析导致的 unexpected send handshake reply #31

Closed
ltxhhz opened this issue Jan 28, 2023 · 9 comments
Closed
Labels
bug Something isn't working

Comments

@ltxhhz
Copy link

ltxhhz commented Jan 28, 2023

作者新年好🎇,软件很好用,我遇到个问题就是我学校的知网链接通过代理无法正常获取到响应,出现的这些报错和通过代理访问非校园网内的链接是一样的,所以我这里是访问了baidu的日志

输出
2023/01/28 19:09:53 socks dial: www.baidu.com:80
2023/01/28 19:09:56 Error occurred while send, retrying: write tcp 192.168.1.101:49332->
    61.138.251.102:443: wsasend: An established connection was aborted by the software in your host machine.
2023/01/28 19:09:56 socket: connected to:  61.138.251.102:443
2023/01/28 19:09:56 tls: connected to:  61.138.251.102:443
2023/01/28 19:09:56 send handshake: wrote 64 bytes
00000000  05 00 00 00 39 65 36 34  62 39 36 33 39 31 38 64  |....9e64b963918d|
00000010  32 66 61 62 63 65 36 31  31 34 65 32 30 30 36 36  |2fabce6114e20066|
00000020  36 30 31 00 32 39 61 33  33 66 61 35 63 63 36 37  |601.29a33fa5cc67|
00000030  32 30 30 36 00 00 00 00  00 00 00 00 15 ef 4b 3b  |2006..........K;|
2023/01/28 19:09:57 send handshake: read 36 bytes
00000000  08 00 00 00 00 00 00 00  00 17 78 02 90 eb 4f 07  |..........x...O.|
00000010  30 39 af e5 ff 7f 00 00  17 0c ca 31 0f 7f 00 00  |09.........1....|
00000020  00 00 00 00                                       |....|
2023/01/28 19:09:57 Error occurred while send, retrying: unexpected send handshake reply
2023/01/28 19:09:57 socket: connected to:  61.138.251.102:443
2023/01/28 19:09:57 tls: connected to:  61.138.251.102:443
2023/01/28 19:09:57 send handshake: wrote 64 bytes
00000000  05 00 00 00 39 65 36 34  62 39 36 33 39 31 38 64  |....9e64b963918d|
00000010  32 66 61 62 63 65 36 31  31 34 65 32 30 30 36 36  |2fabce6114e20066|
00000020  36 30 31 00 32 39 61 33  33 66 61 35 63 63 36 37  |601.29a33fa5cc67|
00000030  32 30 30 36 00 00 00 00  00 00 00 00 15 ef 4b 3b  |2006..........K;|
2023/01/28 19:09:57 send handshake: read 36 bytes
00000000  08 00 00 00 00 00 00 00  00 17 78 02 90 eb 4f 07  |..........x...O.|
00000010  30 39 af e5 ff 7f 00 00  17 0c ca 31 0f 7f 00 00  |09.........1....|
00000020  00 00 00 00                                       |....|
2023/01/28 19:09:57 Error occurred while send, retrying: unexpected send handshake reply
2023/01/28 19:09:57 socket: connected to:  61.138.251.102:443
2023/01/28 19:09:57 tls: connected to:  61.138.251.102:443
2023/01/28 19:09:57 send handshake: wrote 64 bytes
00000000  05 00 00 00 39 65 36 34  62 39 36 33 39 31 38 64  |....9e64b963918d|
00000010  32 66 61 62 63 65 36 31  31 34 65 32 30 30 36 36  |2fabce6114e20066|
00000020  36 30 31 00 32 39 61 33  33 66 61 35 63 63 36 37  |601.29a33fa5cc67|
00000030  32 30 30 36 00 00 00 00  00 00 00 00 15 ef 4b 3b  |2006..........K;|
2023/01/28 19:09:57 send handshake: read 36 bytes
00000000  08 00 00 00 00 00 00 00  00 17 78 02 90 eb 4f 07  |..........x...O.|
00000010  30 39 af e5 ff 7f 00 00  17 0c ca 31 0f 7f 00 00  |09.........1....|
00000020  00 00 00 00                                       |....|
2023/01/28 19:09:57 Error occurred while send, retrying: unexpected send handshake reply
2023/01/28 19:09:57 socket: connected to:  61.138.251.102:443
2023/01/28 19:09:57 tls: connected to:  61.138.251.102:443
2023/01/28 19:09:58 send handshake: wrote 64 bytes
00000000  05 00 00 00 39 65 36 34  62 39 36 33 39 31 38 64  |....9e64b963918d|
00000010  32 66 61 62 63 65 36 31  31 34 65 32 30 30 36 36  |2fabce6114e20066|
00000020  36 30 31 00 32 39 61 33  33 66 61 35 63 63 36 37  |601.29a33fa5cc67|
00000030  32 30 30 36 00 00 00 00  00 00 00 00 15 ef 4b 3b  |2006..........K;|
2023/01/28 19:09:58 send handshake: read 36 bytes
00000000  08 00 00 00 00 00 00 00  00 17 78 02 90 eb 4f 07  |..........x...O.|
00000010  30 39 af e5 ff 7f 00 00  17 0c ca 31 0f 7f 00 00  |09.........1....|
00000020  00 00 00 00                                       |....|
2023/01/28 19:09:58 Error occurred while send, retrying: unexpected send handshake reply
panic: send retry limit exceeded.

goroutine 41 [running]:
EasierConnect/core.StartProtocol.func2()
        EasierConnect/core/protocol.go:210 +0x105
created by EasierConnect/core.StartProtocol
        EasierConnect/core/protocol.go:213 +0x167

这是我用来发送请求的nodejs代码(可证明不是浏览器中其他链接的干扰)

const superagent = require('superagent')
require('superagent-proxy')(superagent)

superagent.get('http://www.baidu.com/')
  .disableTLSCerts()
  .proxy('socks://127.0.0.1:2500')
  .then(e => {
    console.log(e);
  })

不知是不是我使用的操作不当👀

@lyc8503
Copy link
Owner

lyc8503 commented Jan 28, 2023

新年好~
能尝试一下访问校内 ip 的其他资源, 看看会不会出现这样的问题吗? 比如教务处/选课系统/校内 SSH 等一定是校内的机器, 看看能不能正常访问.

@lyc8503 lyc8503 added the bug Something isn't working label Jan 28, 2023
@ltxhhz
Copy link
Author

ltxhhz commented Jan 28, 2023

新年好~ 能尝试一下访问校内 ip 的其他资源, 看看会不会出现这样的问题吗? 比如教务处/选课系统/校内 SSH 等一定是校内的机器, 看看能不能正常访问.

其他api没问题的

@lyc8503
Copy link
Owner

lyc8503 commented Jan 28, 2023

请你打开 EasyConnect 官方客户端连接后 cmd 或者 shell 中运行 nslookup www.cnki.net (或是你要校内访问的那个知网域名.)
然后对比一下关闭官方客户端后执行的结果, 看看 EasyConnect 是否劫持了 DNS.

应该还是路由问题, 和 #17 一样, 等解析路由的功能推出后可以解决这个问题.

@ltxhhz
Copy link
Author

ltxhhz commented Jan 28, 2023

确实是dns的问题,我没想到这一层😋
打扰了,期待新版🎉

@ltxhhz ltxhhz closed this as completed Jan 28, 2023
@lyc8503
Copy link
Owner

lyc8503 commented Jan 28, 2023

这应该是个 bug, socks 协议给出的域名也应该通过 VPN 进行解析而不是直接在本地解析, 当初写的时候偷懒了, 我之后修复一下.

@lyc8503 lyc8503 reopened this Jan 28, 2023
@lyc8503 lyc8503 changed the title unexpected send handshake reply 由于使用本地 DNS 解析导致的 unexpected send handshake reply Jan 28, 2023
@githuu5y5u
Copy link
Contributor

@ltxhhz 老哥你是内网有dns 服务器吗, 感谢@Mythologyl 大佬的提醒, 忘了这一点了

@ltxhhz
Copy link
Author

ltxhhz commented Feb 10, 2023

@ltxhhz 老哥你是内网有dns 服务器吗, 感谢@Mythologyl 大佬的提醒, 忘了这一点了

@githuu5y5u 你好,这个我也不是很清楚,因为官方的软件开了之后会在本地开一个dns服务器,然后会解析出来和其他dns服务器结果不一样的地址,而且这个仓库最后一个版本已经解决了这个问题,所以这个 issue 也可以关闭了😁
另外就是学校的知网似乎有其他验证方法,因为通过代理访问也会重定向到vpn登录页面,不用代理则直接不能访问

@ltxhhz ltxhhz closed this as completed Feb 10, 2023
@githuu5y5u
Copy link
Contributor

githuu5y5u commented Feb 11, 2023

@ltxhhz 知网点用IP登录就行了,一个学校的同时在线数量根据购买知网数据库的协议好像是有限制的。。。
我这里的话这样是可以登录上的,不同学校的环境差异还是挺大的
https://imgur.com/E1eYhNX

@ltxhhz
Copy link
Author

ltxhhz commented Feb 11, 2023

@ltxhhz 知网点用IP登录就行了,一个学校的同时在线数量根据购买知网数据库的协议好像是有限制的。。。 我这里的话这样是可以登录上的,不同学校的环境差异还是挺大的 https://imgur.com/E1eYhNX

官网的这个ip登录检测到的并不是vpn的ip,所以没法登录,我校那个网址用vpn的话是直接以302的方式重定向到vpn登录页的,所以也没法用ip登录😦

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants