question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The certificate for this server is invalid. You might be connecting to a server that is pretending to be “...” which could put your confidential information at risk.

See original GitHub issue

I am trying to do this but get error (IOS 14.2):

The certificate for this server is invalid. You might be connecting to a server that is pretending to be “https://…” which could put your confidential information at risk.

I copied the .cer certificate into xcode and do this:

const response = await fetch(url, {
        method: 'POST',
        body: body,
        pkPinning: true,
        disableAllSecurity: false,
        // your certificates array (needed only in android) ios will pick it automatically
        sslPinning: {
          certs: ['my_cer_file_without_extension'], // your certificates name (without extension)
        },
        headers: {
          Accept: 'application/json; charset=utf-8',
          'Access-Control-Allow-Origin': '*',
          e_platform: 'mobile',
        },
      });

Am I doing something wrong or is it no longer working? Any ideas?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
eliot-yecommented, Dec 28, 2021

The certificate generated by using the key chain of Mac can solve this problem

1reaction
eric-dev-mastercommented, May 31, 2021

@in-html If you resolved this issue, can you share the solution? Working well on android, but not on iOS.

Read more comments on GitHub >

github_iconTop Results From Across the Web

certificate for this server is invalid - Stack Overflow
The certificate for this server is invalid. You might be connecting to a server that is pretending to be "DOMAIN NAME" which could...
Read more >
Get "the certificate for this server is invalid" error? How to fix it
Follow these quick tips when getting certificate errors on your iPhone, iPad, or iPod · Restart your device · Force close the app...
Read more >
The certificate for this server is invalid - Apple Community
You might be connecting to a server that is pretending to be 'msds.open.ac.uk', which could put your confidential information at risk.
Read more >
KB409600: "The certificate for this server is invalid. You might ...
You might be connecting to a server that is pretending to be https://YourWebsite.com which could put your confidential information at risk.
Read more >
How To Fix 'The Certificate For This Server Is Invalid' On Mac
Try restarting the device as some minor issues may pop up with the error 'The certificate for this server is invalid'. Restarting the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found