mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
look for certs in bundled location
This commit is contained in:
parent
bc36aace81
commit
c8b2b5ff87
1 changed files with 13 additions and 2 deletions
15
anki/sync.py
15
anki/sync.py
|
@ -13,7 +13,6 @@ from anki.lang import _
|
|||
from hooks import runHook
|
||||
|
||||
# syncing vars
|
||||
HTTP_CERTS = os.path.join(os.path.dirname(__file__), "ankiweb.certs")
|
||||
HTTP_TIMEOUT = 30
|
||||
HTTP_PROXY = None
|
||||
|
||||
|
@ -21,8 +20,20 @@ HTTP_PROXY = None
|
|||
######################################################################
|
||||
|
||||
def httpCon():
|
||||
certs = os.path.join(os.path.dirname(__file__), "ankiweb.certs")
|
||||
if not os.path.exists(certs):
|
||||
if isWin:
|
||||
certs = os.path.join(
|
||||
os.path.dirname(os.path.abspath(sys.argv[0])),
|
||||
"ankiweb.certs")
|
||||
elif isMac:
|
||||
certs = os.path.join(
|
||||
os.path.dirname(os.path.abspath(sys.argv[0])),
|
||||
"../Resources/ankiweb.certs")
|
||||
else:
|
||||
assert 0
|
||||
return httplib2.Http(
|
||||
timeout=HTTP_TIMEOUT, ca_certs=HTTP_CERTS,
|
||||
timeout=HTTP_TIMEOUT, ca_certs=certs,
|
||||
proxy_info=HTTP_PROXY)
|
||||
|
||||
# Proxy handling
|
||||
|
|
Loading…
Reference in a new issue