ios 此服务器的证书无效
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41690302/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
certificate for this server is invalid
提问by Amanpreet
My app is live. It was working fine. But somedays before we changed the certificates(for security purpose) on Server. And Now whenever I tried to run my app. It is giving error:
我的应用程序已上线。它工作正常。但前几天我们更改了服务器上的证书(出于安全目的)。现在每当我尝试运行我的应用程序时。它给出了错误:
The certificate for this server is invalid. You might be connecting to a server that is pretending to be "DOMAIN NAME" which could put your confidential information at risk.
此服务器的证书无效。您可能正在连接到一个伪装成“域名”的服务器,这可能会使您的机密信息处于危险之中。
I am using Swift3. I want to know Is this front-end issue or server-end? How can I resolve this?
我正在使用 Swift3。我想知道这是前端问题还是服务器端问题?我该如何解决这个问题?
Note:I have searched a lot about the issue, but didn't get the solution. I also tried Titanium - "The certificate for this server is invalid. You might be connecting to a server that is pretending to be DOMAIN.COM”but I was already follow all the steps.
注意:我已经搜索了很多关于这个问题,但没有得到解决方案。我也试过Titanium - “此服务器的证书无效。您可能正在连接到一个假装是 DOMAIN.COM 的服务器”,但我已经按照所有步骤操作。
Other thing is web-app and Android-app is working Ok. But iOS app giving error.
另一件事是 web-app 和 Android-app 工作正常。但 iOS 应用程序出错。
回答by Tushar J.
Solved same issue with just setting devices' date & time to automatic.
通过将设备的日期和时间设置为自动解决了同样的问题。
回答by Scovetta
You can check to see if this is a server-side problem by testing the TLS endpoint using SSL Labs(assuming this is an HTTPS connection). If the results come back invalid, the site will tell you why. If you're using a self-signed certificate, that would certainly cause this error.
您可以通过使用SSL Labs测试 TLS 端点来检查这是否是服务器端问题(假设这是一个 HTTPS 连接)。如果结果返回无效,该站点会告诉您原因。如果您使用的是自签名证书,那肯定会导致此错误。
If the results come back as valid from SSL Labs, then it's probably on the client side. Some client software doesn't have built-in trusted root certificates, but I doubt that Swift doesn't use the default OS root certificate store.
如果结果从 SSL Labs 返回为有效,那么它可能在客户端。一些客户端软件没有内置的可信根证书,但我怀疑 Swift 不使用默认的操作系统根证书存储。
回答by arunjos007
Please also check your firewall restrictions. In my case, this error occurred due to my firewall blocked the required URL. it's worked fine after removing firewall restrictions
另请检查您的防火墙限制。就我而言,发生此错误是由于我的防火墙阻止了所需的 URL。删除防火墙限制后它工作正常
回答by Oshitha Wimalasuriya
Remove https://wwwfrom ServerTrustPolicy and put just url
从 ServerTrustPolicy 中删除https://www并只放置 url