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

ERROR: unable to get local issuer certificate #45

Open
mojtabaahn opened this issue Jan 13, 2025 · 2 comments
Open

ERROR: unable to get local issuer certificate #45

mojtabaahn opened this issue Jan 13, 2025 · 2 comments

Comments

@mojtabaahn
Copy link

mojtabaahn commented Jan 13, 2025

  • portforward version: 0.7.1
  • Python version: 3.10.12
  • Operating System: Ubuntu 22

Description

When i'm trying to port forward to a service in my cluster i get error about ssl certificates.
i tried this on other PCs and it is still the same.

What I Did

import portforward
with portforward.forward('prod-infraa', f"hashemdb-psql-postgresql-ha", 9000, 5432, log_level=portforward.LogLevel.DEBUG):
    pass

error trace:

2025-01-13 15:09:33,887 - django.request - ERROR - Internal Server Error: /paas/postgres/681/index_roles/
Traceback (most recent call last):
  File ".venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File ".venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File ".venv/lib/python3.10/site-packages/sentry_sdk/integrations/django/views.py", line 90, in sentry_wrapped_callback
    return callback(request, *args, **kwargs)
  File ".venv/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 65, in _view_wrapper
    return view_func(request, *args, **kwargs)
  File ".venv/lib/python3.10/site-packages/rest_framework/viewsets.py", line 124, in view
    return self.dispatch(request, *args, **kwargs)
  File ".venv/lib/python3.10/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File ".venv/lib/python3.10/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File ".venv/lib/python3.10/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File ".venv/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "paas/views/postgres.py", line 45, in index_roles
    with Kuber(instance.cluster).port_forward(instance.namespace, instance.name + '-postgresql-ha', '5432') as p:
  File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "paas/lib/kuber.py", line 283, in port_forward
    with portforward.forward(namespace, f"svc/{svc}", int(internal_port), int(port), file.name):
  File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File ".venv/lib/python3.10/site-packages/portforward/__init__.py", line 89, in forward
    raise PortforwardError(err) from None
portforward.PortforwardError: HyperError: error trying to connect: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1919:: unable to get local issuer certificate

Caused by:
    0: error trying to connect: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1919:: unable to get local issuer certificate
    1: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1919:: unable to get local issuer certificate
    2: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1919:
    3: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1919:

@mojtabaahn
Copy link
Author

update: downgrade to 0.5.0 fixed it!

@corka149
Copy link
Contributor

Hi @mojtabaahn

Are you able to share any details on your cluster setup? Like

  • how was it crested?
  • where is it located? awe, azure or so?

Or steps to reproduce it are also helpful.

Thx

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