From 59675d4a5b900e907fd108884f9bbdb80f725e5f Mon Sep 17 00:00:00 2001 From: Blacktwin Date: Thu, 23 Aug 2018 06:30:24 -0400 Subject: [PATCH] SSL --- utility/plex_api_show_settings.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utility/plex_api_show_settings.py b/utility/plex_api_show_settings.py index 3b6d02a..1170a73 100644 --- a/utility/plex_api_show_settings.py +++ b/utility/plex_api_show_settings.py @@ -36,7 +36,17 @@ WATCHED_LST = [0, 1, 7] UNWATCHED_LST = [0, 5, 3, 1, -3, -7,-30] sess = requests.Session() -sess.verify = False +# Ignore verifying the SSL certificate +sess.verify = False # '/path/to/certfile' +# If verify is set to a path to a directory, +# the directory must have been processed using the c_rehash utility supplied +# with OpenSSL. +if sess.verify is False: + # Disable the warning that the request is insecure, we know that... + import urllib3 + + urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) + plex = PlexServer(PLEX_URL, PLEX_TOKEN, session=sess) sections_lst = [x.title for x in plex.library.sections() if x.type == 'show']