Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPSConnectionPool(host='servicodados.ibge.gov.br', port=443): Max retries exceeded with url: /api/v1/localidades/municipios (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)'))) #7

Open
MathewsJosh opened this issue May 15, 2024 · 1 comment

Comments

@MathewsJosh
Copy link

MathewsJosh commented May 15, 2024

Olá Leonardo,

Primeiramente, gostaria de expressar meu agradecimento pela sua dedicação ao criar essa biblioteca. Ela tem sido extremamente útil e acelerou significativamente o desenvolvimento de um projeto pessoal meu.

Infelizmente, hoje me deparei com alguns erros ao executar a minha aplicação dentro de um container Docker que importa sua lib:

Exception has occurred: SSLError       (note: full exception trace is shown but execution is paused at: _run_module_as_main)
HTTPSConnectionPool(host='servicodados.ibge.gov.br', port=443): Max retries exceeded with url: /api/v1/localidades/municipios (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)')))
  File "\opt\conda\envs\myenv\lib\python3.10\site-packages\urllib3\connectionpool.py", line 467, in _make_request
    self._validate_conn(conn)
  File "\opt\conda\envs\myenv\lib\python3.10\site-packages\urllib3\connectionpool.py", line 1099, in _validate_conn
    conn.connect()
  File "\opt\conda\envs\myenv\lib\python3.10\site-packages\urllib3\connection.py", line 653, in connect
    sock_and_verified = _ssl_wrap_socket_and_match_hostname(
  File "\opt\conda\envs\myenv\lib\python3.10\site-packages\urllib3\connection.py", line 806, in _ssl_wrap_socket_and_match_hostname
    ssl_sock = ssl_wrap_socket(
  File "\opt\conda\envs\myenv\lib\python3.10\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 "\opt\conda\envs\myenv\lib\python3.10\site-packages\urllib3\util\ssl_.py", line 509, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "\opt\conda\envs\myenv\lib\python3.10\ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "\opt\conda\envs\myenv\lib\python3.10\ssl.py", line 1104, in _create
    self.do_handshake()
  File "\opt\conda\envs\myenv\lib\python3.10\ssl.py", line 1375, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)

During handling of the above exception, another exception occurred:

  File "\opt\conda\envs\myenv\lib\python3.10\site-packages\urllib3\connectionpool.py", line 793, in urlopen
    response = self._make_request(
  File "\opt\conda\envs\myenv\lib\python3.10\site-packages\urllib3\connectionpool.py", line 491, in _make_request
    raise new_e
urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)

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

  File "\opt\conda\envs\myenv\lib\python3.10\site-packages\requests\adapters.py", line 486, in send
    resp = conn.urlopen(
  File "\opt\conda\envs\myenv\lib\python3.10\site-packages\urllib3\connectionpool.py", line 847, in urlopen
    retries = retries.increment(
  File "\opt\conda\envs\myenv\lib\python3.10\site-packages\urllib3\util\retry.py", line 515, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='servicodados.ibge.gov.br', port=443): Max retries exceeded with url: /api/v1/localidades/municipios (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)')))

Minhas dependências:

opencv_python>=4.6.0.66
opencv_contrib_python>=4.6.0.66
torch>=1.13.1
ultralytics>=8.0.96
protobuf>=3.20.3
blinker>=1.6.2
imutils>=0.5.4
numpy>=1.23.5
pika>=1.3.2
Pillow>=10.1.0
pytz>=2023.3
requests>=2.31.0
spacy>=3.7.2
ibge>=0.0.5
validate-docbr>=1.10.0
levenshtein>=0.23.0
fastapi>=0.103.0
pydantic>=1.10.13
uvicorn>=0.23.2
python-multipart>=0.0.6
pypdfium2>=4.26.0
pytesseract>=0.3.10
oci>=2.122
pdf2image>=1.17.0
sentry-sdk[fastapi]
deskew>=1.5.1
pygelf>=0.4.2
seqlog>=0.3.30
@luanjpb
Copy link
Contributor

luanjpb commented Jun 25, 2024

Verifique o issue #5 . Fiz um PR com a correção que já foi mergeado, mas acredito que a solução ainda não foi enviada ao PyPI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants