주 콘텐츠로 건너뛰기

Python SSL 인증서 오류

답변함
댓글 4개
  • 샘플코드와 보호 활성화, 비활성화 출력도 같이 첨부하겠습니다. 

    ```python

    import requests
    import traceback

    url = "https://naver.com"

    try:
        response = requests.get(url, timeout=5)
        print("Status Code:", response.status_code)
        print("Response Headers:", response.headers)
    except Exception:
        print("An exception occurred:")
        traceback.print_exc()

    ```

     

    Unicorn Pro 활성화시 출력:

    ```

    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/urllib3/connectionpool.py", line 464, in _make_request
        self._validate_conn(conn)
        ~~~~~~~~~~~~~~~~~~~^^^^^^
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/urllib3/connectionpool.py", line 1093, in _validate_conn
        conn.connect()
        ~~~~~~~~~~~~^^
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/urllib3/connection.py", line 790, in connect
        sock_and_verified = _ssl_wrap_socket_and_match_hostname(
            sock=sock,
        ...<14 lines>...
            assert_fingerprint=self.assert_fingerprint,
        )
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/urllib3/connection.py", line 969, in _ssl_wrap_socket_and_match_hostname
        ssl_sock = ssl_wrap_socket(
            sock=sock,
        ...<8 lines>...
            tls_in_tls=tls_in_tls,
        )
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/urllib3/util/ssl_.py", line 480, in ssl_wrap_socket
        ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/urllib3/util/ssl_.py", line 524, in _ssl_wrap_socket_impl
        return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
               ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/ssl.py", line 455, in wrap_socket
        return self.sslsocket_class._create(
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
            sock=sock,
            ^^^^^^^^^^
        ...<5 lines>...
            session=session
            ^^^^^^^^^^^^^^^
        )
        ^
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/ssl.py", line 1076, in _create
        self.do_handshake()
        ~~~~~~~~~~~~~~~~~^^
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/ssl.py", line 1372, in do_handshake
        self._sslobj.do_handshake()
        ~~~~~~~~~~~~~~~~~~~~~~~~~^^
    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1077)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/urllib3/connectionpool.py", line 787, in urlopen
        response = self._make_request(
            conn,
        ...<10 lines>...
            **response_kw,
        )
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/urllib3/connectionpool.py", line 488, in _make_request
        raise new_e
    urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1077)

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

    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/requests/adapters.py", line 644, in send
        resp = conn.urlopen(
            method=request.method,
        ...<9 lines>...
            chunked=chunked,
        )
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/urllib3/connectionpool.py", line 841, in urlopen
        retries = retries.increment(
            method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]
        )
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/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='naver.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1077)')))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/Users/admin/Desktop/test.py", line 7, in <module>
        response = requests.get(url, timeout=5)
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/requests/api.py", line 73, in get
        return request("get", url, params=params, **kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/requests/api.py", line 59, in request
        return session.request(method=method, url=url, **kwargs)
               ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/requests/sessions.py", line 589, in request
        resp = self.send(prep, **send_kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/requests/sessions.py", line 703, in send
        r = adapter.send(request, **kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/requests/adapters.py", line 675, in send
        raise SSLError(e, request=request)
    requests.exceptions.SSLError: HTTPSConnectionPool(host='naver.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1077)')))

    ```

     

    비활성화 시 출력:

    ```

    Status Code: 200
    Response Headers: {'Date': 'Wed, 05 Nov 2025 14:16:40 GMT', 'content-type': 'text/html; charset=UTF-8', 'transfer-encoding': 'chunked', 'set-cookie': 'PM_CK_loc=4d56ea0bcd5ebb74eeff81db19f8e1e1f78bc93eb6657ed553f86b89931103d3; Expires=Thu, 06 Nov 2025 14:16:40 GMT; Path=/; HttpOnly', 'cache-control': 'no-cache, no-store, must-revalidate', 'pragma': 'no-cache', 'x-frame-options': 'DENY', 'x-xss-protection': '1; mode=block', 'content-encoding': 'gzip', 'strict-transport-security': 'max-age=63072000; includeSubdomains', 'referrer-policy': 'unsafe-url', 'server': 'nfront'}

    ```

    0
  • 안녕하세요. 유니콘 고객센터입니다.

    아래 항목들 확인 부탁드립니다.

    1. 테스트할 때 VSCode의 Run/Debug 기능을 사용하셨나요, 아니면 터미널에서 직접 python test.py 명령어로 실행하셨나요?
    2. 유니콘 Pro -> 유니콘 설정 -> 앱 관리에 별도로 추가하신 앱이 있으실까요?
    3. 유니콘 외 VPN, 네트워크 관련 프로그램, 광고 차단 앱, 보안 프로그램 사용중이신게 있으실까요?

     

    0
  • 1. VSCode Run/Debug, python test.py 모두 같은 오류 발생합니다.

    2, 3. 없습니다

    0
  • Status Code: 200
    Response Headers: {'Date': 'Wed, 19 Nov 2025 03:49:58 GMT', 'content-type': 'text/html; charset=UTF-8', 'transfer-encoding': 'chunked', 'set-cookie': 'PM_CK_loc=e99c90a66c60a60c8e7e4c7a8a7c26a6a6e02ed124d859cd948af9dc187d63a6; Expires=Thu, 20 Nov 2025 03:49:58 GMT; Path=/; HttpOnly', 'cache-control': 'no-cache, no-store, must-revalidate', 'pragma': 'no-cache', 'x-frame-options': 'DENY', 'x-xss-protection': '1; mode=block', 'content-encoding': 'gzip', 'strict-transport-security': 'max-age=63072000; includeSubdomains', 'referrer-policy': 'unsafe-url', 'server': 'nfront'}

    동일하게 코드를 작성해서 vscode 내 터미널로 실행했을 때 정상적으로 결과가 출력이 되고 있어서 증상 확인에 어려움이 있습니다.

    고객님께서 문의하신 내용에 대해 정확한 진단과 문제 해결을 위해 원격 지원이 필요할 것으로 보입니다.

    아래 절차에 따라 상담 요청 메시지를 남겨주시면, 실시간 상담 및 원격 지원으로 신속하게 증상을 확인하고 해결을 도와드리겠습니다.

    1. 유니콘 홈페이지에 접속합니다.
    2. 우측 하단의 상담 버튼(물음표 아이콘)을 클릭합니다.
    3. '문의하기'를 선택한 후, '상담사 연결'을 클릭합니다.
    4. '오작동 문의'를 선택합니다.
    5. 사용 중이신 제품 및 OS를 선택한 후, 문제 유형을 선택합니다.
    6. 마지막으로 증상 내용을 상세하게 설명해 주시면 됩니다.

    감사합니다.
    유니콘 고객센터

    0
대화에 참여하세요 댓글을 달려면 가입하거나 로그인하세요.