# Need help: HTTPSConnectionPool(host='api.openai.com', port=443)

**URL:** <https://community.openai.com/t/need-help-httpsconnectionpool-host-api-openai-com-port-443/307729>\
**Category:** API\
**Tags:** api, langchain\
**Created:** [July 24, 2023, 11:53am UTC](https://community.openai.com/t/need-help-httpsconnectionpool-host-api-openai-com-port-443/307729 "2023-07-24T11:53:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![better.maxfeng](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/better.maxfeng/32/511436_2.png) [@better.maxfeng](https://community.openai.com/u/better.maxfeng)\
**Post date:** [July 24, 2023, 11:53am UTC](https://community.openai.com/t/need-help-httpsconnectionpool-host-api-openai-com-port-443/307729/1 "2023-07-24T11:53:16Z")

</div>

Hi all, I am learning to use langchain with openai API. But when I use the following code, I get the error response.

```auto
import datetime
current_date = datetime.datetime.now().date()
if current_date < datetime.date(2023, 9, 2):
    llm_name = "gpt-3.5-turbo-0301"
else:
    llm_name = "gpt-3.5-turbo"
print(llm_name)

from langchain.vectorstores import Chroma
from langchain.embeddings.openai import OpenAIEmbeddings
persist_directory = 'docs/chroma/'
embedding = OpenAIEmbeddings()
vectordb = Chroma(persist_directory=persist_directory, embedding_function=embedding)

question = "What are major topics for this class?"
docs = vectordb.similarity_search(question,k=3)
len(docs)

```

The error response:

```auto
Retrying langchain.embeddings.openai.embed_with_retry.<locals>._embed_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/engines/text-embedding-ada-002/embeddings (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1131)'))).

```

---

<div class="post-metadata">

**Author:** ![novaphil](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/novaphil/32/130934_2.png) [@novaphil](https://community.openai.com/u/novaphil)\
**Post date:** [July 24, 2023, 4:20pm UTC](https://community.openai.com/t/need-help-httpsconnectionpool-host-api-openai-com-port-443/307729/2 "2023-07-24T16:20:33Z")

</div>

You are getting an SSL error trying to reach OpenAI. You likely need to update openssl or your certificates, but I’m not familiar with that aspect of python. Might have better luck asking on LangChain site or googling python SSL errors.

---

<div class="post-metadata">

**Author:** ![alexanderxv9mcd](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@alexanderxv9mcd](https://community.openai.com/u/alexanderxv9mcd)\
**Post date:** [December 6, 2023, 11:28am UTC](https://community.openai.com/t/need-help-httpsconnectionpool-host-api-openai-com-port-443/307729/3 "2023-12-06T11:28:44Z")

</div>

Hi buddy, Is this problem solved? I met the similiar problem with you.

---

<div class="post-metadata">

**Author:** ![alexanderxv9mcd](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@alexanderxv9mcd](https://community.openai.com/u/alexanderxv9mcd)\
**Post date:** [December 7, 2023, 1:17am UTC](https://community.openai.com/t/need-help-httpsconnectionpool-host-api-openai-com-port-443/307729/4 "2023-12-07T01:17:52Z")

</div>

downgrade openai to 0.28.1 and urllib3 to 1.25.11。 it works.
