# SSL Certificate Verification Failure When Connecting to Weaviate in Kubernetes

**URL:** <https://forum.weaviate.io/t/ssl-certificate-verification-failure-when-connecting-to-weaviate-in-kubernetes/2028>\
**Category:** Support\
**Tags:** developer-experience\
**Created:** [April 15, 2024, 6:11pm UTC](https://forum.weaviate.io/t/ssl-certificate-verification-failure-when-connecting-to-weaviate-in-kubernetes/2028 "2024-04-15T18:11:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![coderm](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@coderm](https://forum.weaviate.io/u/coderm)\
**Post date:** [April 15, 2024, 6:11pm UTC](https://forum.weaviate.io/t/ssl-certificate-verification-failure-when-connecting-to-weaviate-in-kubernetes/2028/1 "2024-04-15T18:11:54Z")

</div>

### Description

Hi Guys, I am attempting to set up the Weaviate Python Client to communicate with a Weaviate instance hosted within a Kubernetes cluster. Despite following the available documentation and reviewing similar issues faced by others, I am unable to resolve SSL certificate verification failures.

Specifically, I am trying to run the following block of code:

```auto
os.environ['REQUESTS_CA_BUNDLE'] = "/path/to/weaviate-ca.crt"
os.environ["SSL_CERT_FILE"] = "/path/to/weaviate-tls.crt"
os.environ["GRPC_DEFAULT_SSL_ROOTS_FILE_PATH"] = "/path/to/weaviate-grpc-tls.crt"

weaviate_client = weaviate.connect_to_custom(
    http_host="myurl",
    http_port="443",
    http_secure=True,
    grpc_host="myurl",
    grpc_port="50051",
    grpc_secure=True,
    headers={}
)

```

But am facing the SSL error: ` ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get issuer certificate (_ssl.c:1006)`

If I do a curl for example, like: `curl -v -L http://weaviate.xx 2>&1 | egrep "^> (Host:|GET)"`, I get:

```auto
> GET / HTTP/1.1
> Host: weaviate.xx
> GET / HTTP/2
> Host: weaviate.xx
> GET /v1 HTTP/2
> Host: weaviate.xx

```

So everything seems fine when curling, but you can see that it is doing a redirect from HTTP to HTTPS. So if I set `http_port` to 80 and `http_secure` to False, it will lead to a 308 error.

Has anyone else encountered this issue? Thanks a lot - you guys are doing an amazing job with Weaviate!

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [April 17, 2024, 5:56pm UTC](https://forum.weaviate.io/t/ssl-certificate-verification-failure-when-connecting-to-weaviate-in-kubernetes/2028/2 "2024-04-17T17:56:59Z")

</div>

hi @coderm !

Welcome to our community! 🤗

How are you running?

I have not played around with SSL certs directly into weaviate 😬

But usually I have a reverse proxy in front, and that makes things easier.

Thanks!

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [April 17, 2024, 6:29pm UTC](https://forum.weaviate.io/t/ssl-certificate-verification-failure-when-connecting-to-weaviate-in-kubernetes/2028/3 "2024-04-17T18:29:17Z")

</div>

Have you seen this thread?

Seems related:

> [@Connect to weaviate through v4](https://forum.weaviate.io/t/connect-to-weaviate-through-v4/1969):
>
> Description I need to use v4 to connect my weaviate through ingress. If i use internal url, it works: client = weaviate.WeaviateClient( connection\_params=ConnectionParams.from\_params( http\_host="weaviate.testns.svc.cluster.local", http\_port="80", http\_secure=False, grpc\_host="weaviate-test-grpc.datalake.c.eu-nl-1.cloud.sap", grpc\_port="443", grpc\_secure=False, ), auth\_client\_secret=weaviate.auth.AuthApiKey("jane-secret-key"), …
