From 513f5d0568e48ffbc9d09dfd0fff364f9289893d Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 24 May 2018 11:32:58 +0100 Subject: [PATCH 1/6] added certifi package for Twisted SSL verification on Windows --- lbrynet/daemon/Daemon.py | 6 ++++++ requirements.txt | 1 + 2 files changed, 7 insertions(+) diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index 0304e458a..b553b62bf 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -1,7 +1,9 @@ import binascii +import certifi import logging.handlers import mimetypes import os +import sys import base58 import requests import urllib @@ -231,6 +233,10 @@ class Daemon(AuthJSONRPCServer): @defer.inlineCallbacks def setup(self): + # Set SSL_CERT_FILE env variable for Twisted SSL verification on Windows + if 'win' in sys.platform: + os.environ['SSL_CERT_FILE'] = certifi.where() + reactor.addSystemEventTrigger('before', 'shutdown', self._shutdown) configure_loggly_handler() diff --git a/requirements.txt b/requirements.txt index 7ac7daacf..cad0bf752 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +certifi==2018.4.16 Twisted==16.6.0 cryptography==2.2.2 appdirs==1.4.3 From 03968f377ec9d491163990c88fff57b8e78c9ab1 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 24 May 2018 17:12:47 -0300 Subject: [PATCH 2/6] change fix position to before anything else starts --- lbrynet/daemon/Daemon.py | 5 ----- lbrynet/daemon/DaemonControl.py | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index b553b62bf..a9c44996d 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -1,5 +1,4 @@ import binascii -import certifi import logging.handlers import mimetypes import os @@ -233,10 +232,6 @@ class Daemon(AuthJSONRPCServer): @defer.inlineCallbacks def setup(self): - # Set SSL_CERT_FILE env variable for Twisted SSL verification on Windows - if 'win' in sys.platform: - os.environ['SSL_CERT_FILE'] = certifi.where() - reactor.addSystemEventTrigger('before', 'shutdown', self._shutdown) configure_loggly_handler() diff --git a/lbrynet/daemon/DaemonControl.py b/lbrynet/daemon/DaemonControl.py index 23cd04450..2b8f40260 100644 --- a/lbrynet/daemon/DaemonControl.py +++ b/lbrynet/daemon/DaemonControl.py @@ -1,3 +1,9 @@ +import certifi +# Set SSL_CERT_FILE env variable for Twisted SSL verification on Windows +# This needs to happen before anything else +if 'win' in sys.platform: + os.environ['SSL_CERT_FILE'] = certifi.where() + from lbrynet.core import log_support import argparse From 97547e904ead2af4fa100a7e071a535a91a06301 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 24 May 2018 21:28:09 +0100 Subject: [PATCH 3/6] add os and sys imports --- lbrynet/daemon/DaemonControl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lbrynet/daemon/DaemonControl.py b/lbrynet/daemon/DaemonControl.py index 2b8f40260..42d5cae76 100644 --- a/lbrynet/daemon/DaemonControl.py +++ b/lbrynet/daemon/DaemonControl.py @@ -1,4 +1,7 @@ import certifi +import os +import sys + # Set SSL_CERT_FILE env variable for Twisted SSL verification on Windows # This needs to happen before anything else if 'win' in sys.platform: From c4550ef5b662a3004fbd46eadf7de2f97b11bfd9 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 24 May 2018 22:19:42 +0100 Subject: [PATCH 4/6] remove unused import in lbrynet.daemon.Daemon --- lbrynet/daemon/Daemon.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index a9c44996d..0304e458a 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -2,7 +2,6 @@ import binascii import logging.handlers import mimetypes import os -import sys import base58 import requests import urllib From 0d35621a9a730341021f8869bfe938f821eaab9b Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 24 May 2018 22:55:02 +0100 Subject: [PATCH 5/6] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcc8008b0..200c87d6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ at anytime. * configurable `concurrent_announcers` and `s3_headers_depth` settings * `peer_ping` command * linux distro and desktop name added to analytics + * certifi module for Twisted SSL verification on Windows ### Removed * `announce_all` argument from `blob_announce` From 3d17c92bd3028888e7786589f085a937e699ba91 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Tue, 29 May 2018 22:36:25 -0400 Subject: [PATCH 6/6] moved import certifi to run only on windows --- lbrynet/daemon/DaemonControl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbrynet/daemon/DaemonControl.py b/lbrynet/daemon/DaemonControl.py index 42d5cae76..8d73c9ce0 100644 --- a/lbrynet/daemon/DaemonControl.py +++ b/lbrynet/daemon/DaemonControl.py @@ -1,10 +1,10 @@ -import certifi import os import sys # Set SSL_CERT_FILE env variable for Twisted SSL verification on Windows # This needs to happen before anything else if 'win' in sys.platform: + import certifi os.environ['SSL_CERT_FILE'] = certifi.where() from lbrynet.core import log_support