V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
gxm44
V2EX  ›  移动开发

是不是 iOS 开发中,发送 https 请求,不能使用自定义端口?

  •  
  •   gxm44 · 2018-10-30 17:53:12 +08:00 · 2963 次点击
    这是一个创建于 1976 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我们的 https 服务,使用了自定义的端口 4443,在浏览器,Android 上的 App 请求都是正常的,但是在 iOS 里,会报以下错误

    Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSEerrorFailingURLStringKey=https://xxx.xxx.net:4443/api/v1/users

    切换成标准 443 就没用问题,想请教一下各位大神,在 iOS 里是不支持自定义的 SSL 端口吗?

    1 条回复    2018-10-30 20:25:38 +08:00
    gxm44
        1
    gxm44  
    OP
       2018-10-30 20:25:38 +08:00
    问题解决了,是因为在 iOS 里,是强制使用 TLSv1.2 的,所以 server 端一定要开启 TLSv1.2 的支持。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1191 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 23:17 · PVG 07:17 · LAX 16:17 · JFK 19:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.