File: certs-path.patch

package info (click to toggle)
python-tornado 3.2.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,484 kB
  • ctags: 3,300
  • sloc: python: 18,264; sh: 139; ansic: 45; makefile: 41; xml: 26; sql: 25
file content (17 lines) | stat: -rw-r--r-- 625 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Description: Looks for ca-certificates.crt at the good Debian location before trying local path
Author: Carl Chenet <chaica@ohmytux.com>

--- a/tornado/simple_httpclient.py
+++ b/tornado/simple_httpclient.py
@@ -30,7 +30,10 @@ try:
 except ImportError:
     import urllib.parse as urlparse  # py3
 
-_DEFAULT_CA_CERTS = os.path.dirname(__file__) + '/ca-certificates.crt'
+if os.path.exists('/etc/ssl/certs/ca-certificates.crt'):
+    _DEFAULT_CA_CERTS = '/etc/ssl/certs/ca-certificates.crt'
+else:
+    _DEFAULT_CA_CERTS = os.path.dirname(__file__) + '/ca-certificates.crt'
 
 
 class SimpleAsyncHTTPClient(AsyncHTTPClient):