From df4560412d8334a22c119c87b60259f7ffa9a5c8 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 8 Sep 2016 13:50:45 +0300 Subject: [PATCH] Disable SSL Server-Name-Indication for Python < 2.7.9 --- HISTORY.rst | 5 +++++ platformio/__init__.py | 2 +- platformio/app.py | 3 ++- platformio/managers/lib.py | 6 +++--- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 4b679f84..f1f50e0b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,11 @@ Release Notes PlatformIO 3.0 -------------- +3.0.2 (2016-09-??) +~~~~~~~~~~~~~~~~~~ + +* Disable SSL Server-Name-Indication for Python < 2.7.9 + 3.0.1 (2016-09-08) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/__init__.py b/platformio/__init__.py index 912874a0..38506192 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 0, 1) +VERSION = (3, 0, "2a1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/app.py b/platformio/app.py index 1ca78ed6..6ca23013 100644 --- a/platformio/app.py +++ b/platformio/app.py @@ -14,6 +14,7 @@ import hashlib import json +import sys import uuid from copy import deepcopy from os import environ, getenv @@ -52,7 +53,7 @@ DEFAULT_SETTINGS = { }, "disable_ssl": { "description": "Disable SSL for PlatformIO services", - "value": True + "value": sys.version_info < (2, 7, 9) }, "enable_telemetry": { "description": diff --git a/platformio/managers/lib.py b/platformio/managers/lib.py index 2f8e6ad3..e441aaf3 100644 --- a/platformio/managers/lib.py +++ b/platformio/managers/lib.py @@ -20,7 +20,7 @@ from os.path import dirname, join import click import semantic_version -from platformio import commands, exception, util +from platformio import app, commands, exception, util from platformio.managers.package import BasePkgManager @@ -199,8 +199,8 @@ class LibraryManager(BasePkgManager): pkg_dir = None try: pkg_dir = self._install_from_url( - name, dl_data['url'].replace("http://", "https://"), - requirements) + name, dl_data['url'] if app.get_setting("disable_ssl") else + dl_data['url'].replace("http://", "https://"), requirements) except exception.APIRequestError: pkg_dir = self._install_from_url(name, dl_data['url'], requirements)