맥북 파이썬 SSL 인증 실패 오류 (feat.[SSL: CERTIFICATE_VERIFY_FAILED])

2024. 11. 26. 14:11·OS/Mac

왜 말을 안 듣는거야!!!

그지같은 맥북 (하지만 이쁘죠?)

파이썬 설치하나 하는데도 뭔 인증을 해줘야하는건지

이해가 안간다 (하지만 이쁘죠?)

손 진짜 많이가고 번거로운데 (이쁘니까) 내가 참는다


1) [에러 발생] 파이썬 인증 에러

간만에 OS 싹다 밀고 쓰려니

파이썬이 없네?

파이썬 설치하고 보니 코드가 실행이 안돼

아래와 같은 에러 발생

더보기
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 466, in _make_request
    self._validate_conn(conn)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1095, in _validate_conn
    conn.connect()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connection.py", line 652, in connect
    sock_and_verified = _ssl_wrap_socket_and_match_hostname(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connection.py", line 805, in _ssl_wrap_socket_and_match_hostname
    ssl_sock = ssl_wrap_socket(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 465, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 509, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, 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 "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 490, in _make_request
    raise new_e
urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/ratatou2/Downloads/telegram_alert-master(플젝 최종 ver)/telegram_alert.py", line 22, in <module>
    send_telegram_message(message_content)
  File "/Users/ratatou2/Downloads/telegram_alert-master(플젝 최종 ver)/telegram_alert.py", line 12, in send_telegram_message
    bot.sendMessage(CHAT_ID, message)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telepot/__init__.py", line 513, in sendMessage
    return self._api_request('sendMessage', _rectify(p))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telepot/__init__.py", line 491, in _api_request
    return api.request((self._token, method, params, files), **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telepot/api.py", line 154, in request
    r = fn(*args, **kwargs)  # `fn` must be thread-safe
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/_request_methods.py", line 279, in request_encode_body
    return self.urlopen(method, url, **extra_kw)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/poolmanager.py", line 443, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 873, in urlopen
    return self.urlopen(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 873, in urlopen
    return self.urlopen(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 873, in urlopen
    return self.urlopen(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot6871924649:AAF6v14p8azIcsJPNpp3-52LKpCYvQWuMDQ/sendMessage (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))

인증이 안됐댄다

 

2) [에러 해결] 맥의 파이썬은 인증을 받아야한다

Mac OS 싹다 밀고 다시 설치한건 또 처음이라 찾아보니 맥에 설치한 파이썬은 인증을 받아야한다네...

귀찮은 애증의 이쁜 물건... 해결해보자

 

(1) 파이썬 설치 경로로 간다

저기 보이는 'Install Certificates.command'를 실행

 

뭐가 줄줄줄 나오고는 프로세스 완료된다

(정확히는 인증서 깔렸고, ip 버전 낮다고 옹알옹알)

 

 

3) 해결

이제 실행하면 문제없이 잘 된다

'OS > Mac' 카테고리의 다른 글

2018 맥미니에 Ubuntu 22.04 설치하기 (feat. 부트캠프 없이 우분투만)  (1) 2025.06.17
맥북 단축키 (feat. Mac OS 단축키 모음)  (0) 2025.04.23
맥북 터치바 안될 때 해결방법 (feat. NVRAM (PRAM) / SMC 초기화)  (0) 2025.03.16
2018 맥미니에 Window 10 설치하기 (feat. 부트캠프 없이 윈도우만)  (0) 2025.01.20
맥북 SFTP 연결하기 (feat. NAS 연결하기)  (1) 2024.11.26
'OS/Mac' 카테고리의 다른 글
  • 맥북 단축키 (feat. Mac OS 단축키 모음)
  • 맥북 터치바 안될 때 해결방법 (feat. NVRAM (PRAM) / SMC 초기화)
  • 2018 맥미니에 Window 10 설치하기 (feat. 부트캠프 없이 윈도우만)
  • 맥북 SFTP 연결하기 (feat. NAS 연결하기)
Ratatou2
Ratatou2
온갖 정보들을 기록해두는 메모보드 블로그
  • Ratatou2
    nak-z
    Ratatou2
  • 전체
    오늘
    어제
  • 공지사항

    • 블로그 이전 진행 중 (24.11.25 ~)
    • 분류 전체보기 (209) N
      • OS (71) N
        • Linux (39) N
        • Window (20)
        • Mac (7) N
        • Android (5) N
      • Infra (51) N
        • Docker (22) N
        • Jenkins (9)
        • n8n (13)
        • Nextcloud (1)
        • Rasberry Pi (6)
      • Dev (12)
        • JAVA (3)
        • Python (0)
        • DB (3)
        • Vue (2)
        • AI (4)
        • Git (0)
      • CS & Algorithm (42) N
        • CS (1)
        • Algorithm (41) N
      • Game (10)
        • Zomboid (9)
        • Don't Starve Together (1)
      • etc (23) N
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 인기 글

  • . hELLO· Designed By정상우.v4.10.1 .
Ratatou2
맥북 파이썬 SSL 인증 실패 오류 (feat.[SSL: CERTIFICATE_VERIFY_FAILED])
상단으로

티스토리툴바