Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

certificate for this server is invalid

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?

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.

Other thing is web-app and Android-app is working Ok. But iOS app giving error.

like image 949
Amanpreet Avatar asked Jan 17 '17 06:01

Amanpreet


Video Answer


4 Answers

Solved same issue with just setting devices' date & time to automatic.

like image 188
Tushar J. Avatar answered Oct 11 '22 14:10

Tushar J.


Remove https://www from ServerTrustPolicy and put just url

like image 29
Oshitha Wimalasuriya Avatar answered Oct 11 '22 13:10

Oshitha Wimalasuriya


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

like image 38
arunjos007 Avatar answered Oct 11 '22 13:10

arunjos007


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.

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.

like image 41
Scovetta Avatar answered Oct 11 '22 13:10

Scovetta