Reputation: 33
Last year I wrote a Python script to query the SEC's EDGAR database to retrieve their index of company filings for various years and quarters. At the time, the script worked fine but I recently picked it back up only to find that now I receive SSL: CERTIFICATE_VERIFY_FAILED errors whenever running it.
I did an SSL Server test on the the following path: https://www.sec.gov/Archives/edgar/full-index/2018/QTR2/company.idx
The report indicates all passes for the certificate (linked here)
Also interestingly, if you navigate directly to the path in browser, an "Access Denied" error is returned. If I'm remembering correctly, in the past this would have led to the index file being downloaded. I know that the SEC's EDGAR database has recently gone through some restructuring as they no longer support FTP services.
Does anyone have any idea what might be happening here and why I get SSL errors?
For further background, I'm using urllib.request.urlopen()
Thanks in advance.
Upvotes: 0
Views: 180
Reputation: 33
Took a bit of digging, but I found the answer to this question. Full credit to Craig Glennie who posted the answer in a response to a question elsewhere on Stack Overflow: urllib and "SSL: CERTIFICATE_VERIFY_FAILED" Error
I didn't realize that the out of the box Python 3.6 installed on OS-X does not have any certificates (as detailed in the ReadMe.rtf file with Python 3.6). Running /Applications/Python\ 3.6/Install\ Certificates.command got everything squared away.
Upvotes: 0