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.
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.
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.
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.
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.
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.
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?
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.
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.