[Tip] Mac Python 3.X Urllib의 SSL: CERTIFICATE_VERIFY_FAILED 오류 해결
MacOS 의 Python 3.6은 시스템 인증서 저장소를 사용하지 않는 OpenSSL 의 임베디드 저장소를 사용한다. Install Certificates.command 파일을 실행하여, 설치해주면 Urllib 에서 https 프로토콜로 정상적인 접근이 가능하다.
/Applications/Python 3.X/
해당 경로로 이동하면, Install Certificates.command 라는 파일이 존재한다. 실행해주자.
$ /Applications/Python\ 3.6/Install\ Certificates.command ; exit;
-- pip install --upgrade certifi
Requirement already up-to-date: certifi in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
-- removing any existing file or link
-- creating symlink to certifi certificate bundle
-- setting permissions
-- update complete
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
다시 파이썬 코드를 실행하면 https 로 접속이 잘되는 모습을 확인할 수 있다.