SSL Certificate Error in VSCode

All of a sudden, I am getting SSL certificate errors from PlatformIO. I tried deleting the .platformio directory. When I opened VSCode the next time, it reinstalled and will compile my project, but when it comes to upload it, it’s not able to install avrdude and I get the same error:

such as the one below:

Processing megaatmega2560 (platform: atmelavr; board: megaatmega2560; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Tool Manager: Installing platformio/tool-avrdude @ ~1.60300.0
Error: HTTPSConnectionPool(host='api.registry.nm1.platformio.org', port=443): Max retries exceeded with url: /v3/packages/platformio/tool/tool-avrdude (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))

I’ve wasted most of a day trying just to get back to where I was before, i.e. with a working system that will compile and upload. It’s driving me nuts.

If I open https://api.registry.ns1.platformio.org/, I get a screen with links for v1, v2 and v3. If I select v3, I get the following error:


Something went wrong…

Cannot read properties of undefined (reading ‘readFile’)Stack trace

Error: Cannot read properties of undefined (reading ‘readFile’) at t.BaseResolver. (/redoc/redoc-demo.bundle.js:8:74579) at Generator.next () at /redoc-demo.bundle.js:8:72726 at new Promise () at n (/redoc/redoc-demo.bundle.js:8:72471) at t.BaseResolver.loadExternalRef (https://redocly.github.io/redoc/redoc-demo.bundle.js:8:74361) at t.BaseResolver. (/redoc/redoc-demo.bundle.js:8:75092) at Generator.next () at redoc-demo.bundle.js:8:72726 at new Promise ()

ReDoc Version: 2.0.0-rc.70
Commit: 6b7283f2

I’ve also done VS Code File>Preferences>Settings search for ssl, Application>Proxy and unchecked Proxy Strict SSL but it seems to make no difference.

Does anyone have some advice please?

Looks fine in my browser

Did you do this in VSCode or in the browser?

Thanks for the quick reply. I opened that link in the browser, Chrome in my case.
I’m ashamed to admit that I do not know how to open a web page in VSCode.

When I click on v3, I get taken to this URL https://redocly.github.io/redoc/?url=https://api.registry.platformio.org/v3/openapi.yaml, which shows the error I posted previously.

Do you have any suggestions as to what I can try? It doesnt seem to make a difference whether I try it at work or at home, so I don’t think it’s a proxy issue.

This is all I get when I open the link https://api.registry.ns1.platformio.org/:

There are no certificates shown.
I have tried reinstalling PIO, reinstalling Python, reinstalling VSCode.
I’ve read everything online relating to this issue but I am now completely roadblocked.
I cannot continue with my development now. I am really desperate for some support, please.

Did you install Python with the Install Certificates option per Redirecting...?

Also checkout Ssl error(platform io) - #3 by lordniksidor if youare behind a proxy.

If that does not help, open an issue in Issues · platformio/platformio-core · GitHub

There is no Install Certificates option with Python, I am running Windows. I did, however, manually add the certifi module using the Python console. Not sure it makes a difference.
But the thing is, everything was working fine for months and one day the error started and I have no idea what happened to cause this.

Also, I did check out the topic you linked. I did try that already, the PIO homepage loads just fine. The issue I am having is installing third party modules / libraries.

OK, so I didn’t realise I needed to click the padlock. This is what is listed under the certificates:

Someone is heavily screwing with the certificates while they’re in transit. The certificate chain for https://api.registry.nm1.platformio.org/ is supposed to be

The “Cisco” certificates probably come from some ““Security”” product that does SSL inspection (and thus a really nice invasion of privacy). Likely you’re in some corporarate network or behind a proxy?

Since you say you have done what PlatformIO SSL error while upgrading using vscode - #3 by lordniksidor says and it still fails, I have no further ideas. Please create an issue at Issues · platformio/platformio-core · GitHub, best with what SSL interceptor product you have the pleasure of dealing with.

Oh balls. OK, well it was all working just fine until very recently so perhaps there has been some corporate spyware rolled out recently. I tried it on a different (non-domain) machine and everything works perfectly so that must be it.

Thanks for your help, I really appreciate it.

In case anyone was wondering what eventually happened, it turns out that https inspection on my corporate network was recently turned on which caused the issues.

The way I got around it was to request that IT exclude *.platformio.org from https inspection. Now instead of the red error, I get a yellow warning that the certificates don’t match, but PIO searches for another mirror and eventually downloads correctly.

1 Like