platformio-vscode-ide: SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version

Running macOS 10.12.3, Visual Studio Code 1.20.1, and PlatformIO IDE extension version 0.12.1.

After installing the PlatformIO IDE extension and reloading VSCode, the installation of PlatformIO fails with the following error:

PIP: Exception:
Traceback (most recent call last):
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/commands/install.py", line 335, in run
    wb.build(autobuilding=True)
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/req/req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/download.py", line 821, in unpack_url
    hashes=hashes
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/download.py", line 659, in unpack_http_url
    hashes)
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/download.py", line 853, in _download_http_url
    stream=True,
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 488, in get
    return self.request('GET', url, **kwargs)
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/download.py", line 386, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.py", line 47, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/Users/thomas/.platformio/penv/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py", line 497, in send
    raise SSLError(e, request=request)
SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)

So far as I can tell, this is being caused by an older version of OpenSSL on my system. However, I can’t find a way to get the Python penv (in ~/.platformio/penv/) installed by PlatformIO to utilize the newer version of OpenSSL (1.0.2n) and Python (2.7.14) I’ve installed using brew.

I’ve been using VSCode with the PlatformIO IDE extension for months, and today it just stopped working. I was getting the same TLSV1_ALERT_PROTOCOL_VERSION error when just trying to build a project I’ve built hundreds of times in the past. I tried completely uninstalling VSCode (and deleting all of it’s support files in the system) and reinstalling from scratch, but I can’t get past this error.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 32 (13 by maintainers)

Most upvoted comments

I have solved the issue by performing these steps

Download get-pip.py from https://bootstrap.pypa.io/get-pip.py Launch terminal or command prompt cd to Downloads folder or where the get-pip.py is downloaded

Run command python get-pip.py

And Yo, every installation is working now Njoy

Ashutosh Gupta

Could you try to install pyopenssl in penv?

(penv) pip install pyopenssl platformio 
(penv) platformio upgrade -–dev

My ~/.bash_profile already contained the following:

export PATH="/usr/local/opt/openssl/bin:/usr/local/opt/python/libexec/bin:$PATH"

As such, it appears that the python version is not being found in the order you’re expecting.