platformio-core-installer icon indicating copy to clipboard operation
platformio-core-installer copied to clipboard

CERTIFICATE_VERIFY_FAILED

Open Seng22 opened this issue 5 years ago • 19 comments

Solution

  1. Please check your Internet connection
  2. Please check your proxy settings
  3. Your government or internet provider blocks the official Python package registry https://pypi.org/

%23 Description of problem Leave a comment...

BEFORE SUBMITTING, PLEASE SEARCH FOR DUPLICATES IN

  • https://github.com/platformio/platformio-vscode-ide/issues%3Fq=is%3Aissue

%23 Configuration

VSCode: 1.49.2 PIO IDE: v2.1.0 System: Windows_NT, 10.0.18363, x64

%23 Exception

Error:   WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000029FB8FEA188>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/platformio/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000029FB8FEA6C8>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/platformio/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000029FB8FE5F88>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/platformio/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000029FB8FE5608>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/platformio/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0000029FB8FE5988>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/platformio/
ERROR: Could not find a version that satisfies the requirement platformio (from versions: none)
ERROR: No matching distribution found for platformio
Error: Could not install PlatformIO Core: If you have antivirus/firewall/defender software in a system, try to disable it for a while.
Command '['C:\\Users\\ISIS\\.platformio\\penv\\Scripts\\python.exe', '-m', 'pip', 'install', '-U', 'platformio']' returned non-zero exit status 1.
-> Installer version: 0.3.5
Platform: Windows-10
Python version: 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC v.1900 64 bit (AMD64)]
Python path: C:\Users\ISIS\.platformio\python3\python.exe
Creating a virtual environment at C:\Users\ISIS\.platformio\penv
Updating Python package manager (PIP) in a virtual environment
Virtual environment has been successfully created!
Installing PlatformIO Core
Collecting platformio

	at c:\Users\ISIS\.vscode\extensions\platformio.platformio-ide-2.1.0\node_modules\platformio-node-helpers\dist\index.js:1:4911
	at ChildProcess.s (c:\Users\ISIS\.vscode\extensions\platformio.platformio-ide-2.1.0\node_modules\platformio-node-helpers\dist\index.js:1:4807)
	at ChildProcess.emit (events.js:223:5)
	at ChildProcess.cp.emit (c:\Users\ISIS\.vscode\extensions\platformio.platformio-ide-2.1.0\node_modules\cross-spawn\lib\enoent.js:34:29)
	at maybeClose (internal/child_process.js:1021:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Seng22 avatar Sep 27 '20 08:09 Seng22

I'm having the same issue.

kqkyler avatar Dec 04 '20 19:12 kqkyler

Hi all, I'd like to share a solution that simply worked for my configuration.

My installation problem recap During Build command i get "CERTIFICATE_VERIFY_FAILED" error downloading a requested package.

Diagnose My company use a remote proxy that acts as a "man in the middle" and can change the SSL certificate, used to secure the connection, to its own certificate. This means that the python env needs to know and validate all the certification path for this certificate. In my case the "middle" certificate comes from "blue coat systems" and is issued fom "Cloud Services CA".

For completeness this is the full path used by pip to download package (generating the error) https://api.registry.ns1.platformio.org/v3/packages?query=type%3A%22platform%22+name%3A%22espressif8266%22

Solution Obviously my company have to setup our pc to be full functional, this means that in the windows cetificate repository are installed all the certificates we need to have succesfull internet surfing. Searching a bit. I've found this script: https://pypi.org/project/python-certifi-win32/ that merge the certificates in the windows repository to the certificates used by pip

I've simply installed the script using the command shown at the project's page issued in the terminal window of vscode. thanks to the merging the ssl verification is now ok.

I post it because it's a typical configuration for corporate users. edit: typos correction

FulvioSpelta avatar Dec 06 '20 09:12 FulvioSpelta

I haven't found the exact cause for why this happened on my macOS setup yet, will edit this if I do, but something that might point people in the right direction is that I feel like Brew updating openSSL did this. You can either use pyenv to switch to a non-broken Python, or re-install Python with:

brew uninstall python3
brew install python3

d3v-null avatar Dec 23 '20 11:12 d3v-null

I had a firewall. I block all countries outside the US so I added the platformio.org website to my white list and that solved it for me.

SrGeek avatar Feb 28 '21 02:02 SrGeek

Disabling the HTTPS scanning feature of my antivirus has fixed this problem for me. I suspect it's because the AV performs a man-in-the-middle attack on all HTTPS traffic in order to scan it.

PowerShellNibbixwoud avatar Oct 30 '21 15:10 PowerShellNibbixwoud

国内可以换一下国内镜像源解决 比如: pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

karl129 avatar Oct 26 '23 02:10 karl129

国内可以换一下国内镜像源解决 比如: pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

PS C:\Users\tao> pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple Writing to C:\Users\tao\AppData\Roaming\pip\pip.ini

Many thanks.

huster-songtao avatar Oct 27 '23 06:10 huster-songtao

国内可以换一下国内镜像源解决 比如: pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

我试了这个方法,可以

fpk1 avatar Oct 29 '23 07:10 fpk1

This sends me to this page but i haven't found a working solution image

jpsaila avatar Jan 16 '24 08:01 jpsaila

This sends me to this page but i haven't found a working solution

You posted too few info. Could be that your problem is the "man in the middle" that use a certificate with weak key but you have to analyze more your environment.

FulvioSpelta avatar Jan 16 '24 08:01 FulvioSpelta

This sends me to this page but i haven't found a working solution

You posted too few info. Could be that your problem is the "man in the middle" that use a certificate with weak key but you have to analyze more your environment.

there's not much i can post - i got an error when installing the platformio extension on visual studio code, there was a link to follow that got me here and no working solution!

jpsaila avatar Feb 07 '24 08:02 jpsaila

I was getting the same error message as @jpsaila, I was ultimately able to get it working by checking VSCode dev tools and looking for the Python command it was running, and running it in a terminal directly.

Of course after that I was hitting a different error with "No module named pkg_resources" and I ended up just copying/pasting commands from the VSCode terminal into the regular terminal, but maybe it'll help someone make it further.

The command I had was: python3 /Users/[MYUSERNAME]/.platformio/.cache/tmp/get-platformio-1.2.2.py on macOS running Python3 from Homebrew.

mccahan avatar Mar 23 '24 19:03 mccahan

我发现如果出现这个错误,你可以用杀毒软件自带的网络修复功能扫描一下。我的情况就是出现了异常,并且我用软件修复了它,然后一切都解决了。

327w avatar Jun 24 '24 16:06 327w

On Windows, I was using the Malwarebytes Firewall and had to temporarily disable it, then add a filter rule, to allow PlatformIO to install, as it was failing to show the usual, can this app have permission to get outbound connection.

emaines avatar Aug 18 '24 00:08 emaines

This same error message is occurring to me as well, in this case the failure seems to be caused by my firewall which considers pypi.org to be a malicious site - not totally incorrect given the focus hackers have on the Python infrastructure even recently. Ah well, was hoping this wouldn't require Python...

Reynolds-Beta avatar Sep 27 '24 18:09 Reynolds-Beta