Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
39b0836
Removed option to disable SSL_VERIFY from netatmo camera
ryanm101 Dec 18, 2017
5849e50
Removed option to disable SSL_VERIFY from synology camera
ryanm101 Dec 18, 2017
637e549
Removed option to disable SSL_VERIFY from unifi device tracker
ryanm101 Dec 18, 2017
9ccebb2
Removed option to disable SSL_VERIFY from linksys_ap device tracker
ryanm101 Dec 18, 2017
b63f8da
Removed option to disable SSL_VERIFY from influxdb
ryanm101 Dec 18, 2017
2f2aae5
Removed option to disable SSL_VERIFY from plex media_player
ryanm101 Dec 18, 2017
a5694d5
Removed option to disable SSL_VERIFY from notify matrix
ryanm101 Dec 18, 2017
2581700
Removed option to disable SSL_VERIFY from influxdb sensor
ryanm101 Dec 18, 2017
0fb24e8
Removed option to disable SSL_VERIFY from pi-hole sensor
ryanm101 Dec 18, 2017
4d83084
Removed option to disable SSL_VERIFY from rest binary_sensor
ryanm101 Dec 18, 2017
59f6456
Removed option to disable SSL_VERIFY from rest sensor
ryanm101 Dec 18, 2017
f038c13
Fixed Call to RestData that is imported
ryanm101 Dec 18, 2017
ab0f307
Removed option to disable SSL_VERIFY from pvoutput sensor, depended o…
ryanm101 Dec 18, 2017
391ea18
Removed option to disable SSL_VERIFY from qnap sensor
ryanm101 Dec 18, 2017
7b0668a
Removed option to disable SSL_VERIFY from scrape sensor, depended on …
ryanm101 Dec 18, 2017
c57ac6d
Removed option to disable SSL_VERIFY from luftdaten sensor
ryanm101 Dec 18, 2017
2607462
fix after removing option to disable SSL_VERIFY from pi-hole sensor, …
ryanm101 Dec 18, 2017
0fabdfc
fix after removing option to disable SSL_VERIFY from rest sensor, thi…
ryanm101 Dec 18, 2017
60c7a38
Resetting luftdaten to upstream/dev as the option to disable VERIFY_S…
ryanm101 Dec 18, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions homeassistant/components/binary_sensor/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from homeassistant.components.sensor.rest import RestData
from homeassistant.const import (
CONF_PAYLOAD, CONF_NAME, CONF_VALUE_TEMPLATE, CONF_METHOD, CONF_RESOURCE,
CONF_VERIFY_SSL, CONF_USERNAME, CONF_PASSWORD,
CONF_USERNAME, CONF_PASSWORD,
CONF_HEADERS, CONF_AUTHENTICATION, HTTP_BASIC_AUTHENTICATION,
HTTP_DIGEST_AUTHENTICATION, CONF_DEVICE_CLASS)
import homeassistant.helpers.config_validation as cv
Expand All @@ -23,7 +23,6 @@

DEFAULT_METHOD = 'GET'
DEFAULT_NAME = 'REST Binary Sensor'
DEFAULT_VERIFY_SSL = True

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_RESOURCE): cv.url,
Expand All @@ -37,7 +36,6 @@
vol.Optional(CONF_DEVICE_CLASS): DEVICE_CLASSES_SCHEMA,
vol.Optional(CONF_USERNAME): cv.string,
vol.Optional(CONF_VALUE_TEMPLATE): cv.template,
vol.Optional(CONF_VERIFY_SSL, default=DEFAULT_VERIFY_SSL): cv.boolean,
})


Expand All @@ -47,7 +45,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
resource = config.get(CONF_RESOURCE)
method = config.get(CONF_METHOD)
payload = config.get(CONF_PAYLOAD)
verify_ssl = config.get(CONF_VERIFY_SSL)
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
headers = config.get(CONF_HEADERS)
Expand All @@ -64,7 +61,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
else:
auth = None

rest = RestData(method, resource, auth, headers, payload, verify_ssl)
rest = RestData(method, resource, auth, headers, payload)
rest.update()

if rest.data is None:
Expand Down
10 changes: 3 additions & 7 deletions homeassistant/components/camera/netatmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import requests
import voluptuous as vol

from homeassistant.const import CONF_VERIFY_SSL
from homeassistant.components.netatmo import CameraData
from homeassistant.components.camera import (Camera, PLATFORM_SCHEMA)
from homeassistant.loader import get_component
Expand All @@ -23,7 +22,6 @@
CONF_CAMERAS = 'cameras'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_VERIFY_SSL, default=True): cv.boolean,
vol.Optional(CONF_HOME): cv.string,
vol.Optional(CONF_CAMERAS, default=[]):
vol.All(cv.ensure_list, [cv.string]),
Expand All @@ -35,7 +33,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up access to Netatmo cameras."""
netatmo = get_component('netatmo')
home = config.get(CONF_HOME)
verify_ssl = config.get(CONF_VERIFY_SSL, True)
import lnetatmo
try:
data = CameraData(netatmo.NETATMO_AUTH, home)
Expand All @@ -46,20 +43,19 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
camera_name not in config[CONF_CAMERAS]:
continue
add_devices([NetatmoCamera(data, camera_name, home,
camera_type, verify_ssl)])
camera_type)])
except lnetatmo.NoDevice:
return None


class NetatmoCamera(Camera):
"""Representation of the images published from a Netatmo camera."""

def __init__(self, data, camera_name, home, camera_type, verify_ssl):
def __init__(self, data, camera_name, home, camera_type):
"""Set up for access to the Netatmo camera images."""
super(NetatmoCamera, self).__init__()
self._data = data
self._camera_name = camera_name
self._verify_ssl = verify_ssl
if home:
self._name = home + ' / ' + camera_name
else:
Expand All @@ -81,7 +77,7 @@ def camera_image(self):
self._localurl), timeout=10)
elif self._vpnurl:
response = requests.get('{0}/live/snapshot_720.jpg'.format(
self._vpnurl), timeout=10, verify=self._verify_ssl)
self._vpnurl), timeout=10, verify=True)
else:
_LOGGER.error("Welcome VPN URL is None")
self._data.update()
Expand Down
5 changes: 2 additions & 3 deletions homeassistant/components/camera/synology.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from homeassistant.const import (
CONF_NAME, CONF_USERNAME, CONF_PASSWORD,
CONF_URL, CONF_WHITELIST, CONF_VERIFY_SSL, CONF_TIMEOUT)
CONF_URL, CONF_WHITELIST, CONF_TIMEOUT)
from homeassistant.components.camera import (
Camera, PLATFORM_SCHEMA)
from homeassistant.helpers.aiohttp_client import (
Expand All @@ -34,14 +34,13 @@
vol.Required(CONF_URL): cv.string,
vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT): cv.positive_int,
vol.Optional(CONF_WHITELIST, default=[]): cv.ensure_list,
vol.Optional(CONF_VERIFY_SSL, default=True): cv.boolean,
})


@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
"""Set up a Synology IP Camera."""
verify_ssl = config.get(CONF_VERIFY_SSL)
verify_ssl = True
timeout = config.get(CONF_TIMEOUT)

try:
Expand Down
6 changes: 2 additions & 4 deletions homeassistant/components/device_tracker/linksys_ap.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from homeassistant.components.device_tracker import (
DOMAIN, PLATFORM_SCHEMA, DeviceScanner)
from homeassistant.const import (
CONF_HOST, CONF_PASSWORD, CONF_USERNAME, CONF_VERIFY_SSL)
CONF_HOST, CONF_PASSWORD, CONF_USERNAME)

INTERFACES = 2
DEFAULT_TIMEOUT = 10
Expand All @@ -27,7 +27,6 @@
vol.Required(CONF_HOST): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Required(CONF_USERNAME): cv.string,
vol.Optional(CONF_VERIFY_SSL, default=True): cv.boolean,
})


Expand All @@ -47,7 +46,6 @@ def __init__(self, config):
self.host = config[CONF_HOST]
self.username = config[CONF_USERNAME]
self.password = config[CONF_PASSWORD]
self.verify_ssl = config[CONF_VERIFY_SSL]
self.last_results = []

# Check if the access point is accessible
Expand Down Expand Up @@ -95,5 +93,5 @@ def _make_request(self, unit=0):
url = 'https://{}/StatusClients.htm&&unit={}&vap=0'.format(
self.host, unit)
return requests.get(
url, timeout=DEFAULT_TIMEOUT, verify=self.verify_ssl,
url, timeout=DEFAULT_TIMEOUT, verify=True,
cookies={'LoginName': login, 'LoginPWD': pwd})
6 changes: 1 addition & 5 deletions homeassistant/components/device_tracker/unifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from homeassistant.components.device_tracker import (
DOMAIN, PLATFORM_SCHEMA, DeviceScanner)
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
from homeassistant.const import CONF_VERIFY_SSL
import homeassistant.util.dt as dt_util

REQUIREMENTS = ['pyunifi==2.13']
Expand All @@ -36,8 +35,6 @@
vol.Required(CONF_PASSWORD): cv.string,
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PORT, default=DEFAULT_PORT): cv.port,
vol.Optional(CONF_VERIFY_SSL, default=DEFAULT_VERIFY_SSL): vol.Any(
cv.boolean, cv.isfile),
vol.Optional(CONF_DETECTION_TIME, default=DEFAULT_DETECTION_TIME): vol.All(
cv.time_period, cv.positive_timedelta)
})
Expand All @@ -52,12 +49,11 @@ def get_scanner(hass, config):
password = config[DOMAIN].get(CONF_PASSWORD)
site_id = config[DOMAIN].get(CONF_SITE_ID)
port = config[DOMAIN].get(CONF_PORT)
verify_ssl = config[DOMAIN].get(CONF_VERIFY_SSL)
detection_time = config[DOMAIN].get(CONF_DETECTION_TIME)

try:
ctrl = Controller(host, username, password, port, version='v4',
site_id=site_id, ssl_verify=verify_ssl)
site_id=site_id, ssl_verify=True)
except APIError as ex:
_LOGGER.error("Failed to connect to Unifi: %s", ex)
hass.components.persistent_notification.create(
Expand Down
6 changes: 2 additions & 4 deletions homeassistant/components/influxdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from homeassistant.const import (
EVENT_STATE_CHANGED, STATE_UNAVAILABLE, STATE_UNKNOWN, CONF_HOST,
CONF_PORT, CONF_SSL, CONF_VERIFY_SSL, CONF_USERNAME, CONF_PASSWORD,
CONF_PORT, CONF_SSL, CONF_USERNAME, CONF_PASSWORD,
CONF_EXCLUDE, CONF_INCLUDE, CONF_DOMAINS, CONF_ENTITIES)
from homeassistant.helpers import state as state_helper
from homeassistant.helpers.entity_values import EntityValues
Expand All @@ -37,7 +37,6 @@
CONF_RETRY_QUEUE = 'retry_queue_limit'

DEFAULT_DATABASE = 'home_assistant'
DEFAULT_VERIFY_SSL = True
DOMAIN = 'influxdb'
TIMEOUT = 5

Expand Down Expand Up @@ -71,7 +70,6 @@
vol.Schema({cv.string: cv.string}),
vol.Optional(CONF_TAGS_ATTRIBUTES, default=[]):
vol.All(cv.ensure_list, [cv.string]),
vol.Optional(CONF_VERIFY_SSL, default=DEFAULT_VERIFY_SSL): cv.boolean,
vol.Optional(CONF_COMPONENT_CONFIG, default={}):
vol.Schema({cv.entity_id: COMPONENT_CONFIG_SCHEMA_ENTRY}),
vol.Optional(CONF_COMPONENT_CONFIG_GLOB, default={}):
Expand All @@ -93,7 +91,7 @@ def setup(hass, config):

kwargs = {
'database': conf[CONF_DB_NAME],
'verify_ssl': conf[CONF_VERIFY_SSL],
'verify_ssl': True,
'timeout': TIMEOUT
}

Expand Down
22 changes: 2 additions & 20 deletions homeassistant/components/media_player/plex.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
has_ssl = host_config['ssl']
except KeyError:
has_ssl = False
try:
verify_ssl = host_config['verify']
except KeyError:
verify_ssl = True

# Via discovery
elif discovery_info is not None:
Expand All @@ -78,28 +74,20 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
return
token = None
has_ssl = False
verify_ssl = True
else:
return

setup_plexserver(
host, token, has_ssl, verify_ssl,
hass, config, add_devices_callback
)
setup_plexserver(host, token, has_ssl, hass, config, add_devices_callback)


def setup_plexserver(
host, token, has_ssl, verify_ssl, hass, config, add_devices_callback):
host, token, has_ssl, hass, config, add_devices_callback):
"""Set up a plexserver based on host parameter."""
import plexapi.server
import plexapi.exceptions

cert_session = None
http_prefix = 'https' if has_ssl else 'http'
if has_ssl and (verify_ssl is False):
_LOGGER.info("Ignoring SSL verification")
cert_session = requests.Session()
cert_session.verify = False
try:
plexserver = plexapi.server.PlexServer(
'%s://%s' % (http_prefix, host),
Expand All @@ -125,7 +113,6 @@ def setup_plexserver(
hass.config.path(PLEX_CONFIG_FILE), {host: {
'token': token,
'ssl': has_ssl,
'verify': verify_ssl,
}})

_LOGGER.info('Connected to: %s://%s', http_prefix, host)
Expand Down Expand Up @@ -220,7 +207,6 @@ def plex_configuration_callback(data):
setup_plexserver(
host, data.get('token'),
cv.boolean(data.get('has_ssl')),
cv.boolean(data.get('do_not_verify')),
hass, config, add_devices_callback
)

Expand All @@ -238,10 +224,6 @@ def plex_configuration_callback(data):
'id': 'has_ssl',
'name': 'Use SSL',
'type': ''
}, {
'id': 'do_not_verify_ssl',
'name': 'Do not verify SSL',
'type': ''
}])


Expand Down
8 changes: 3 additions & 5 deletions homeassistant/components/notify/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import (ATTR_TARGET, PLATFORM_SCHEMA,
BaseNotificationService)
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD, CONF_VERIFY_SSL
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD
from homeassistant.util.json import load_json, save_json

REQUIREMENTS = ['matrix-client==0.0.6']
Expand All @@ -27,7 +27,6 @@

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_HOMESERVER): cv.url,
vol.Optional(CONF_VERIFY_SSL, default=True): cv.boolean,
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Required(CONF_DEFAULT_ROOM): cv.string,
Expand All @@ -43,7 +42,6 @@ def get_service(hass, config, discovery_info=None):
os.path.join(hass.config.path(), SESSION_FILE),
config.get(CONF_HOMESERVER),
config.get(CONF_DEFAULT_ROOM),
config.get(CONF_VERIFY_SSL),
config.get(CONF_USERNAME),
config.get(CONF_PASSWORD))

Expand All @@ -54,15 +52,15 @@ def get_service(hass, config, discovery_info=None):
class MatrixNotificationService(BaseNotificationService):
"""Send Notifications to a Matrix Room."""

def __init__(self, config_file, homeserver, default_room, verify_ssl,
def __init__(self, config_file, homeserver, default_room,
username, password):
"""Set up the client."""
self.session_filepath = config_file
self.auth_tokens = self.get_auth_tokens()

self.homeserver = homeserver
self.default_room = default_room
self.verify_tls = verify_ssl
self.verify_tls = True
self.username = username
self.password = password

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/sensor/dwd_weather_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def __init__(self, region_name):
'jsonp=loadWarnings'
)

self._rest = RestData('GET', resource, None, None, None, True)
self._rest = RestData('GET', resource, None, None, None)
self.region_name = region_name
self.region_id = None
self.region_state = None
Expand Down
7 changes: 2 additions & 5 deletions homeassistant/components/sensor/influxdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (CONF_HOST, CONF_PORT, CONF_USERNAME,
CONF_PASSWORD, CONF_SSL, CONF_VERIFY_SSL,
CONF_PASSWORD, CONF_SSL,
CONF_NAME, CONF_UNIT_OF_MEASUREMENT,
CONF_VALUE_TEMPLATE)
from homeassistant.const import STATE_UNKNOWN
Expand All @@ -28,7 +28,6 @@
DEFAULT_PORT = 8086
DEFAULT_DATABASE = 'home_assistant'
DEFAULT_SSL = False
DEFAULT_VERIFY_SSL = False
DEFAULT_GROUP_FUNCTION = 'mean'
DEFAULT_FIELD = 'value'

Expand Down Expand Up @@ -59,7 +58,6 @@
vol.Inclusive(CONF_USERNAME, 'authentication'): cv.string,
vol.Inclusive(CONF_PASSWORD, 'authentication'): cv.string,
vol.Optional(CONF_SSL, default=DEFAULT_SSL): cv.boolean,
vol.Optional(CONF_VERIFY_SSL, default=DEFAULT_VERIFY_SSL): cv.boolean
})

# Return cached results if last scan was less then this time ago
Expand All @@ -74,7 +72,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
'port': config.get(CONF_PORT),
'ssl': config.get(CONF_SSL),
'username': config.get(CONF_USERNAME),
'verify_ssl': config.get(CONF_VERIFY_SSL),
}

dev = []
Expand Down Expand Up @@ -112,7 +109,7 @@ def __init__(self, hass, influx_conf, query):
host=influx_conf['host'], port=influx_conf['port'],
username=influx_conf['username'], password=influx_conf['password'],
database=database, ssl=influx_conf['ssl'],
verify_ssl=influx_conf['verify_ssl'])
verify_ssl=True)
try:
influx.query("select * from /.*/ LIMIT 1;")
self.connected = True
Expand Down
Loading