Created
November 17, 2018 13:46
-
-
Save Cogitri/47d097ed218e5261d95b85e47ab762c5 to your computer and use it in GitHub Desktop.
0001-use-system-cacerts.patch.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From d294a09e802694f7cf1fbf64e99818759d934b34 Mon Sep 17 00:00:00 2001 | |
| From: Rasmus Thomsen <[email protected]> | |
| Date: Sat, 17 Nov 2018 14:45:08 +0100 | |
| Subject: [PATCH] use-system-cacerts.patch | |
| --- | |
| buku.py | 15 ++++++++------- | |
| setup.py | 1 - | |
| 2 files changed, 8 insertions(+), 8 deletions(-) | |
| diff --git a/buku.py b/buku.py | |
| index dc64850..0e515de 100755 | |
| --- buku.py | |
| +++ buku.py | |
| @@ -19,7 +19,8 @@ | |
| import argparse | |
| from bs4 import BeautifulSoup | |
| -import certifi | |
| +def where(): | |
| + return '/etc/ssl/certs/ca-certificates.crt' | |
| import cgi | |
| import collections | |
| import json | |
| @@ -2497,12 +2498,12 @@ class BukuDb: | |
| gen_headers() | |
| if myproxy: | |
| - manager = urllib3.ProxyManager(myproxy, num_pools=1, headers=myheaders, cert_reqs='CERT_REQUIRED', ca_certs=certifi.where()) | |
| + manager = urllib3.ProxyManager(myproxy, num_pools=1, headers=myheaders, cert_reqs='CERT_REQUIRED', ca_certs=where()) | |
| else: | |
| manager = urllib3.PoolManager(num_pools=1, | |
| headers={'User-Agent': USER_AGENT}, | |
| cert_reqs='CERT_REQUIRED', | |
| - ca_certs=certifi.where()) | |
| + ca_certs=where()) | |
| try: | |
| r = manager.request('POST', _u, headers={'content-type': 'application/json', 'User-Agent': USER_AGENT}) | |
| @@ -3193,9 +3194,9 @@ def get_PoolManager(): | |
| if myproxy: | |
| return urllib3.ProxyManager(myproxy, num_pools=1, headers=myheaders, timeout=15, | |
| - cert_reqs='CERT_REQUIRED', ca_certs=certifi.where()) | |
| + cert_reqs='CERT_REQUIRED', ca_certs=where()) | |
| - return urllib3.PoolManager(num_pools=1, headers=myheaders, timeout=15, cert_reqs='CERT_REQUIRED', ca_certs=certifi.where()) | |
| + return urllib3.PoolManager(num_pools=1, headers=myheaders, timeout=15, cert_reqs='CERT_REQUIRED', ca_certs=where()) | |
| def network_handler(url, http_head=False): | |
| @@ -3999,12 +4000,12 @@ def check_upstream_release(): | |
| gen_headers() | |
| if myproxy: | |
| - manager = urllib3.ProxyManager(myproxy, num_pools=1, headers=myheaders, cert_reqs='CERT_REQUIRED', ca_certs=certifi.where()) | |
| + manager = urllib3.ProxyManager(myproxy, num_pools=1, headers=myheaders, cert_reqs='CERT_REQUIRED', ca_certs=where()) | |
| else: | |
| manager = urllib3.PoolManager(num_pools=1, | |
| headers={'User-Agent': USER_AGENT}, | |
| cert_reqs='CERT_REQUIRED', | |
| - ca_certs=certifi.where()) | |
| + ca_certs=where()) | |
| try: | |
| r = manager.request('GET', 'https://api.github.com/repos/jarun/buku/releases?per_page=1', headers={'User-Agent': USER_AGENT}) | |
| diff --git a/setup.py b/setup.py | |
| index e27f5f4..fc456b0 100644 | |
| --- setup.py | |
| +++ setup.py | |
| @@ -56,7 +56,6 @@ setup( | |
| py_modules=['buku'], | |
| install_requires=[ | |
| 'beautifulsoup4>=4.4.1', | |
| - 'certifi', | |
| 'cryptography>=1.2.3', | |
| 'urllib3>=1.13.1', | |
| 'html5lib>=1.0.1', | |
| -- | |
| 2.19.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment