File tree Expand file tree Collapse file tree 4 files changed +17
-5
lines changed
wolframclient/evaluation/cloud Expand file tree Collapse file tree 4 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ def load_tests():
6767 'aiohttp' ,
6868 'oauthlib' ,
6969 'pyzmq' ,
70+ 'certifi>=2017.4.17' # for consistency with requests module.
7071 ],
7172 classifiers = CLASSIFIERS ,
7273 project_urls = {
Original file line number Diff line number Diff line change 1111 XAuthAIOHttpAsyncSession as XAuthAsyncSession ,
1212)
1313from wolframclient .evaluation .cloud .base import WolframAPICallBase
14- from wolframclient .evaluation .cloud .server import WOLFRAM_PUBLIC_CLOUD_SERVER
14+ from wolframclient .evaluation .cloud .server import WOLFRAM_PUBLIC_CLOUD_SERVER , DEFAULT_CA_PATH
1515from wolframclient .evaluation .result import (
1616 WolframAPIResponseBuilder ,
1717 WolframEvaluationWXFResponseAsync ,
@@ -65,10 +65,12 @@ def __init__(
6565 if self .server .certificate is not None :
6666 self ._ssl_context = self .ssl_context_class ()
6767 self ._ssl_context .load_verify_locations (self .server .certificate )
68- # self._ssl_context = ssl.create_default_context(cafile=self.server.certificate)
68+ elif DEFAULT_CA_PATH :
69+ self ._ssl_context = ssl .create_default_context (cafile = DEFAULT_CA_PATH )
6970 else :
7071 self ._ssl_context = None
7172
73+
7274 def duplicate (self ):
7375 return self .__class__ (
7476 credentials = self .credentials ,
Original file line number Diff line number Diff line change 11from __future__ import absolute_import , print_function , unicode_literals
22
33import logging
4-
54from wolframclient .evaluation .cloud .base import OAuthAsyncSessionBase , UserIDPassword
5+ from wolframclient .evaluation .cloud .server import DEFAULT_CA_PATH
66from wolframclient .exception import AuthenticationException
77from wolframclient .utils import six
88from wolframclient .utils .api import aiohttp , oauth , ssl
@@ -35,7 +35,8 @@ def __init__(
3535 if self .server .certificate is not None :
3636 self ._ssl_context = self .ssl_context_class ()
3737 self ._ssl_context .load_verify_locations (self .server .certificate )
38- # self._ssl_context = ssl.create_default_context(cafile=self.server.certificate)
38+ elif DEFAULT_CA_PATH :
39+ self ._ssl_context = ssl .create_default_context (cafile = DEFAULT_CA_PATH )
3940 else :
4041 self ._ssl_context = None
4142
Original file line number Diff line number Diff line change 11from __future__ import absolute_import , print_function , unicode_literals
22
33from wolframclient .utils import six
4+ try :
5+ import certifi
6+ DEFAULT_CA_PATH = certifi .where ()
7+ except ImportError :
8+ certifi = None
9+ DEFAULT_CA_PATH = None
10+ pass
411
5- __all__ = ["WolframServer" ]
12+
13+ __all__ = ["WolframServer" , "DEFAULT_CA_PATH" ]
614
715
816class WolframServer (object ):
You can’t perform that action at this time.
0 commit comments