Rename setting DISABLE_SSL to ENABLE_DISABLE and set it to No by default

This commit is contained in:
Ivan Kravets
2016-09-12 02:11:04 +03:00
parent 7d10041727
commit ac7743e217
7 changed files with 16 additions and 22 deletions

View File

@ -163,6 +163,6 @@ Allows to override setting :ref:`setting_enable_telemetry`.
Allows to override setting :ref:`setting_force_verbose`.
.. envvar:: PLATFORMIO_SETTING_DISABLE_SSL
.. envvar:: PLATFORMIO_SETTING_ENABLE_SSL
Allows to override setting :ref:`setting_disable_ssl`.
Allows to override setting :ref:`setting_enable_ssl`.

View File

@ -87,15 +87,15 @@ Check for the new PlatformIO interval.
Check for the platform updates interval.
.. _setting_disable_ssl:
.. _setting_enable_ssl:
``disable_ssl``
^^^^^^^^^^^^^^^
``enable_ssl``
^^^^^^^^^^^^^^
:Default: No
:Values: Yes/No
Disable SSL for PlatformIO API (NOT RECOMMENDED, INSECURE)
Enable SSL for PlatformIO Services
.. _setting_force_verbose:

View File

@ -14,7 +14,7 @@
import sys
VERSION = (3, 0, "2a1")
VERSION = (3, 0, "2a2")
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"

View File

@ -14,7 +14,6 @@
import hashlib
import json
import sys
import uuid
from copy import deepcopy
from os import environ, getenv
@ -51,9 +50,9 @@ DEFAULT_SETTINGS = {
"description": "Force verbose output when processing environments",
"value": False
},
"disable_ssl": {
"description": "Disable SSL for PlatformIO services",
"value": sys.version_info < (2, 7, 9)
"enable_ssl": {
"description": "Enable SSL for PlatformIO Services",
"value": False
},
"enable_telemetry": {
"description":

View File

@ -196,15 +196,10 @@ class LibraryManager(BasePkgManager):
dl_data = util.get_api_result(
"/lib/download/" + str(name[3:]), dict(version=version))
assert dl_data
pkg_dir = None
try:
pkg_dir = self._install_from_url(
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)
return pkg_dir
return self._install_from_url(
name, dl_data['url'].replace("http://", "https://")
if app.get_setting("enable_ssl") else dl_data['url'], requirements)
def install(self, # pylint: disable=too-many-arguments
name,

View File

@ -31,7 +31,7 @@ class PlatformManager(BasePkgManager):
if not repositories:
repositories = [
"{0}://dl.platformio.org/platforms/manifest.json".format(
"http" if app.get_setting("disable_ssl") else "https")
"https" if app.get_setting("enable_ssl") else "http")
]
BasePkgManager.__init__(self, package_dir or
join(util.get_home_dir(), "platforms"),

View File

@ -382,7 +382,7 @@ def _get_api_result(
headers = get_request_defheaders()
url = __apiurl__
if get_setting("disable_ssl"):
if not get_setting("enable_ssl"):
url = url.replace("https://", "http://")
try: