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`. 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. Check for the platform updates interval.
.. _setting_disable_ssl: .. _setting_enable_ssl:
``disable_ssl`` ``enable_ssl``
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
:Default: No :Default: No
:Values: Yes/No :Values: Yes/No
Disable SSL for PlatformIO API (NOT RECOMMENDED, INSECURE) Enable SSL for PlatformIO Services
.. _setting_force_verbose: .. _setting_force_verbose:

View File

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

View File

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

View File

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

View File

@ -31,7 +31,7 @@ class PlatformManager(BasePkgManager):
if not repositories: if not repositories:
repositories = [ repositories = [
"{0}://dl.platformio.org/platforms/manifest.json".format( "{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 BasePkgManager.__init__(self, package_dir or
join(util.get_home_dir(), "platforms"), join(util.get_home_dir(), "platforms"),

View File

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