certificate for this server is invalid
Asked Answered
C

7

20

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.

Crime answered 17/1, 2017 at 6:24 Comment(0)
O
14

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

Oira answered 25/7, 2017 at 9:42 Comment(1)
It perfectly worked for me. Thank you, Tushar. What is the underlying problem? How it is related to Date and Time?Vivyan
E
5

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.

Eipper answered 17/1, 2017 at 6:31 Comment(5)
Thanks for information. I tried that and I can see there is column that shows RC4:Yes INSECURE (more info). Do you know How can we make it secure?Crime
RC4 is a cipher enabled on the server. What kind of web-server are you using?Eipper
I am using Apache.Crime
Here's a link on configuring Apache with strong cipher suites. To get rid of RC4, you can either use the suggested SSLCipherSuite (from the link) or add :!RC4: to the existing SSLCipherSuite configuration directive.Eipper
Ok.. I will check that. Is we usually face that kind of issues from certificates, Do you have any idea?Crime
J
2

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

Jetport answered 10/8, 2017 at 4:56 Comment(0)
S
2

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

Santinasantini answered 18/9, 2019 at 8:48 Comment(0)
K
0

I just ran into this issue with a user and it appears iOS14 enables TLS1.3. I updated my web server's ssh settings (I'm using nginx) to support this version and that fixed the issue. I'm not sure that it solves op's problem but it may help a human from the future.

http {
    ...
    ##
    # SSL Settings
    ##

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;
    ...

}

src: https://developer.apple.com/forums/thread/655074?answerId=622645022#622645022

Katmandu answered 17/12, 2020 at 23:20 Comment(0)
A
0

The solution that worked for me is that I open the url that is giving me error and I allowed web site by clicking visit this website. enter image description here

Analphabetic answered 10/4 at 9:23 Comment(0)
T
0

If you go to Date & Time deactivate automatic and activate again it works too. Worked for me perfectly.

Tacy answered 10/8 at 17:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.