V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
wwzzj
V2EX  ›  问与答

求助, openwrt 上 curl 认证校园网报错 ServerKeyExchange Failed。

  •  
  •   wwzzj · 270 天前 · 718 次点击
    这是一个创建于 270 天前的主题,其中的信息可能已经有所发展或是发生改变。

    用 curl 做校园网认证,相同得命令在本地可以正常运行,在 openwrt 上出现以下报错:

    curl: (35) ssl_handshake returned - mbedTLS: (-0x7B00) SSL - Processing of the ServerKeyExchange handshake message failed
    

    有大佬知道是怎么回事吗?

    说明:

    • 路由器已克隆电脑 MAC 地址,改了最后一个 bit 。
    • curl 命令没有问题,在 windows 上执行可以顺利通过校园网认证。
    • 已修改路由器时区为 Shanghai 。
    • 通过 AP 模式路由器可以 curl https://www.baidu.comhttps://www.163.com ,但 curl 校园网网关还是会报错。
    • 使用 openssl 测试,错误信息如下:
    root@OpenWrt:~# openssl s_client -connect https://***.***.edu.cn
    78801CB67F000000:error:10080002:BIO routines:BIO_lookup_ex:system lib:crypto/bio/bio_addr.c:738:Unrecognized service
    connect:errno=22
    
    7 条回复    2023-08-24 01:44:52 +08:00
    1423
        1
    1423  
       270 天前
    用静态编译的 curl 试试
    tyzandhr
        2
    tyzandhr  
       270 天前 via Android
    看看 openert 上 ssl 版本?虽然我猜校园网也不会用太新的 tls 协议才对
    wwzzj
        3
    wwzzj  
    OP
       270 天前
    @1423 谢谢大佬,用静态编译的 curl 成功了!
    wwzzj
        4
    wwzzj  
    OP
       270 天前
    @tyzandhr 这是因为用了 TLSv1.3 的原因吗?

    TLSv1.3 (OUT), TLS handshake, Client hello (1):
    * CAfile: /etc/ssl/certs/ca-certificates.crt
    * CApath: none
    * TLSv1.3 (IN), TLS handshake, Server hello (2):
    * TLSv1.2 (IN), TLS handshake, Certificate (11):
    * TLSv1.2 (IN), TLS handshake, Server finished (14):
    * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
    * TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
    * TLSv1.2 (OUT), TLS handshake, Finished (20):
    * TLSv1.2 (IN), TLS handshake, Finished (20):
    tyzandhr
        5
    tyzandhr  
       270 天前 via Android
    @wwzzj #4 看 logout 样子不是……
    yinmin
        6
    yinmin  
       270 天前
    (1) curl 加--tlsv1.0 或者--tlsv1.2 参数试试
    curl https://**.edu.cn --tlsv1.2

    (2) 你的 openssl 的指令错了,应该是:
    openssl s_client -connect ***.edu.cn:443
    vsyf
        7
    vsyf  
       270 天前 via Android
    10 年前我也是在 openwrt 搞校园网客户端,我们那时候还是用的锐捷。转眼过去这么久了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   842 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:14 · PVG 05:14 · LAX 14:14 · JFK 17:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.