TradeViaPython / a3_aliceblue

Apache License 2.0
12 stars 4 forks source link

Url open error. Certification failed #12

Open karthi84 opened 1 year ago

karthi84 commented 1 year ago

When i try to download master data i am getting URL open error with certification failure. Error as below

Master Contract Downloading (After 8:00am today data available else previous day)....Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1346, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1285, in request self._send_request(method, url, body, headers, encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1331, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1040, in _send_output self.send(msg) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 980, in send self.connect() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1454, in connect self.sock = self._context.wrap_socket(self.sock, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 501, in wrap_socket return self.sslsocket_class._create( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1041, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1310, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Volumes/Data/Programming/Python/Trading/AliceBlue_V2/AliceLogin.py", line 15, in alice.download_master_contract(to_csv=True) # Download initially once a day File "/Volumes/Data/Programming/Python/Trading/AliceBlue_V2/venv/lib/python3.9/site-packages/AliceBlue_V2/AliceBlue_V2.py", line 478, in download_master_contract self.master_contract = pd.read_csv( File "/Volumes/Data/Programming/Python/Trading/AliceBlue_V2/venv/lib/python3.9/site-packages/pandas/util/_decorators.py", line 211, in wrapper return func(*args, kwargs) File "/Volumes/Data/Programming/Python/Trading/AliceBlue_V2/venv/lib/python3.9/site-packages/pandas/util/_decorators.py", line 331, in wrapper return func(args, kwargs) File "/Volumes/Data/Programming/Python/Trading/AliceBlue_V2/venv/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 950, in read_csv return _read(filepath_or_buffer, kwds) File "/Volumes/Data/Programming/Python/Trading/AliceBlue_V2/venv/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 605, in _read parser = TextFileReader(filepath_or_buffer, kwds) File "/Volumes/Data/Programming/Python/Trading/AliceBlue_V2/venv/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 1442, in init self._engine = self._make_engine(f, self.engine) File "/Volumes/Data/Programming/Python/Trading/AliceBlue_V2/venv/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 1735, in _make_engine self.handles = get_handle( File "/Volumes/Data/Programming/Python/Trading/AliceBlue_V2/venv/lib/python3.9/site-packages/pandas/io/common.py", line 713, in get_handle ioargs = _get_filepath_or_buffer( File "/Volumes/Data/Programming/Python/Trading/AliceBlue_V2/venv/lib/python3.9/site-packages/pandas/io/common.py", line 363, in _get_filepath_or_buffer with urlopen(req_info) as req: File "/Volumes/Data/Programming/Python/Trading/AliceBlue_V2/venv/lib/python3.9/site-packages/pandas/io/common.py", line 265, in urlopen return urllib.request.urlopen(args, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 214, in urlopen return opener.open(url, data, timeout) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 517, in open response = self._open(req, data) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 534, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 494, in _call_chain result = func(*args) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1389, in https_open return self.do_open(http.client.HTTPSConnection, req, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1349, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)>

Process finished with exit code 1