사내망(프록시/보안장비) 환경에서는 TLS 트래픽을 중간에서 검사(MITM)하는 경우가 많습니다. 이때 PC/런타임이 사내 Root CA(사설 인증서) 를 신뢰하지 못하면 CERTIFICATE_VERIFY_FAILED 계열 SSL 에러가 납니다.

1) Poetry 자체 업데이트(poetry self update) 실패

아래 명령으로 Poetry 버전 업그레이드를 시도했으나 SSL 인증이 실패했습니다.

poetry self update

삭제 후 재설치를 해도 동일한 SSL 에러가 발생했습니다.

curl -sSL https://install.python-poetry.org | python3 - --uninstall
curl -sSL https://install.python-poetry.org | python3 -

pip 쪽은 아래처럼 “신뢰할 수 있는 호스트”를 환경변수로 넣고 재시도할 수 있습니다.

export PIP_TRUSTED_HOST="pypi.org pypi.python.org files.pythonhosted.org"
  • PIP_TRUSTED_HOST는 pip의 -trusted-host 옵션에 대응되는 환경변수입니다.

  • 다만 이 방식은 호스트를 “신뢰 처리”해 SSL 검증을 약하게 만드는 우회책 성격이라, 장기적으로는 권장되지 않습니다.


2) 패키지 설치(poetry install --no-root) 시 SSL 에러

Poetry는 재설치했는데도 poetry install --no-root 실행 중 urllib3files.pythonhosted.org에 접근하면서 SSL 에러가 날 수 있습니다.

제가 적용한 우회 해결은 다음과 같습니다.

poetry config certificates.PyPI.certfalse
poetrysource add fpho https://files.pythonhosted.org/simple --priority=supplemental
poetry config certificates.fpho.certfalse

poetry cache clear pypi --all -n
poetry lock# 구버전의 경우 아래와 같이 옵션을 주어야 합니다. (현재 버전 2.1.4)# poetry lock --no-update
poetry install --no-root -vvv
  • poetry config certificates.PyPI.cert false

  • poetry source add fpho https://files.pythonhosted.org/simple --priority=supplemental

  • poetry config certificates.fpho.cert false

  • poetry cache clear pypi --all -n

  • poetry lock

  • poetry install --no-root