Local running lamma3. httpx.connecterror [wrong ssl] #92

Open
opened 2026-02-15 16:27:57 -05:00 by yindo · 1 comment
Owner

Originally created by @chkp-orendi on GitHub (Jun 4, 2024).

Hello :)

I'm trying to run locally lamma3 on ubuntu 20.04.
I installed everything and it all seem to be working.
Running ollama run llama3:8b let me chat with him. And running ollama serve seems to work.

I tried coppying this code:

import ollama
response = ollama.chat(model='llama3', messages=[
  {
    'role': 'user',
    'content': 'Why is the sky blue?',
  },
])
print(response['message']['content'])

But I get an error:
httpx.ConnectError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)

image image

If you need any more information let me know.
Thank you :)

Originally created by @chkp-orendi on GitHub (Jun 4, 2024). Hello :) I'm trying to run locally lamma3 on ubuntu 20.04. I installed everything and it all seem to be working. Running ```ollama run llama3:8b``` let me chat with him. And running ```ollama serve``` seems to work. I tried coppying this code: ``` import ollama response = ollama.chat(model='llama3', messages=[ { 'role': 'user', 'content': 'Why is the sky blue?', }, ]) print(response['message']['content']) ``` But I get an error: httpx.ConnectError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131) <img width="575" alt="image" src="https://github.com/ollama/ollama-python/assets/81114522/9a25db16-efbe-4e98-9154-98b475f8ce9b"> <img width="567" alt="image" src="https://github.com/ollama/ollama-python/assets/81114522/0ff4d716-63cc-4be8-bd88-f65a0b1ff0ff"> If you need any more information let me know. Thank you :)
Author
Owner

@umarbektokyo commented on GitHub (Jul 21, 2024):

Hey!

Here are some things which might help:

  1. Try updating httpx and ollama libraries:
    pip install --upgrade httpx ollama
  2. Check python version (V3.6 or higher is recommended)
  3. Verify Server Configuration; confirm that the server is running 'ollama serve' and its configured correctly and it's using compatible SSL/TLS version
  4. Test connectivity; try connecting to the server using different tool, such as 'curl', to ensure that the server is working:
    curl -v https://your-server-url

I hope it helps. Good luck with your project ;]

@umarbektokyo commented on GitHub (Jul 21, 2024): Hey! Here are some things which might help: 1. **Try updating httpx and ollama libraries**: ```pip install --upgrade httpx ollama``` 2. **Check python version** (V3.6 or higher is recommended) 3. **Verify Server Configuration**; confirm that the server is running 'ollama serve' and its configured correctly and it's using compatible SSL/TLS version 4. **Test connectivity**; try connecting to the server using different tool, such as 'curl', to ensure that the server is working: ```curl -v https://your-server-url``` I hope it helps. Good luck with your project ;]
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#92