ollama - 💡(How to fix) Fix Ollama fails with TLS error [5 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#14763Fetched 2026-04-08 00:31:55
View on GitHub
Comments
5
Participants
2
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
commented ×5closed ×1labeled ×1

Error Message

$ ollama run minimax-m2:cloud Connecting to 'minimax-m2' on 'ollama.com' ⚡

hello? Error: 500 Internal Server Error: Post "https://ollama.com:443/api/chat?ts=1773149088": tls: failed to verify certificate: SecPolicyCreateSSL error: 0

Code Example

$ ollama run minimax-m2:cloud 
Connecting to 'minimax-m2' on 'ollama.com'>>> hello?
Error: 500 Internal Server Error: Post "https://ollama.com:443/api/chat?ts=1773149088": tls: failed to verify certificate: SecPolicyCreateSSL error: 0

---

[GIN] 2026/03/10 - 13:26:45 | 200 |   39.998093ms |       127.0.0.1 | POST     "/api/me"
time=2026-03-10T13:26:46.050Z level=ERROR source=routes.go:1873 msg="Post \"https://ollama.com/api/me?ts=1773149206\": tls: failed to verify certificate: SecPolicyCreateSSL error: 0"
[GIN] 2026/03/10 - 13:26:46 | 200 |   34.226141ms |       127.0.0.1 | POST     "/api/me"
time=2026-03-10T13:26:47.098Z level=ERROR source=routes.go:1873 msg="Post \"https://ollama.com/api/me?ts=1773149207\": tls: failed to verify certificate: SecPolicyCreateSSL error: 0"
[GIN] 2026/03/10 - 13:26:47 | 200 |   42.904667ms |       127.0.0.1 | POST     "/api/me"
[GIN] 2026/03/10 - 13:26:48 | 200 |      665.12µs |       127.0.0.1 | GET      "/api/tags"
time=2026-03-10T13:26:48.637Z level=ERROR source=routes.go:1873 msg="Post \"https://ollama.com/api/me?ts=1773149208\": tls: failed to verify certificate: SecPolicyCreateSSL error: 0"
[GIN] 2026/03/10 - 13:26:48 | 200 |   34.049137ms |       127.0.0.1 | POST     "/api/me"
RAW_BUFFERClick to expand / collapse

What is the issue?

$ ollama run minimax-m2:cloud 
Connecting to 'minimax-m2' on 'ollama.com'>>> hello?
Error: 500 Internal Server Error: Post "https://ollama.com:443/api/chat?ts=1773149088": tls: failed to verify certificate: SecPolicyCreateSSL error: 0

Relevant log output

[GIN] 2026/03/10 - 13:26:45 | 200 |   39.998093ms |       127.0.0.1 | POST     "/api/me"
time=2026-03-10T13:26:46.050Z level=ERROR source=routes.go:1873 msg="Post \"https://ollama.com/api/me?ts=1773149206\": tls: failed to verify certificate: SecPolicyCreateSSL error: 0"
[GIN] 2026/03/10 - 13:26:46 | 200 |   34.226141ms |       127.0.0.1 | POST     "/api/me"
time=2026-03-10T13:26:47.098Z level=ERROR source=routes.go:1873 msg="Post \"https://ollama.com/api/me?ts=1773149207\": tls: failed to verify certificate: SecPolicyCreateSSL error: 0"
[GIN] 2026/03/10 - 13:26:47 | 200 |   42.904667ms |       127.0.0.1 | POST     "/api/me"
[GIN] 2026/03/10 - 13:26:48 | 200 |      665.12µs |       127.0.0.1 | GET      "/api/tags"
time=2026-03-10T13:26:48.637Z level=ERROR source=routes.go:1873 msg="Post \"https://ollama.com/api/me?ts=1773149208\": tls: failed to verify certificate: SecPolicyCreateSSL error: 0"
[GIN] 2026/03/10 - 13:26:48 | 200 |   34.049137ms |       127.0.0.1 | POST     "/api/me"

OS

macOS/Intel/Mini

Ollama version

0.17.7

extent analysis

Fix Plan

The fix involves disabling certificate verification for the HTTPS connection or providing a valid certificate.

Step-by-Step Solution:

  1. Disable Certificate Verification: You can disable certificate verification by setting the TLSClientConfig to InsecureSkipVerify to true. However, this is not recommended for production environments as it makes the connection vulnerable to man-in-the-middle attacks.

    import (
        "crypto/tls"
        "net/http"
    )
    
    // ...
    
    tr := &http.Transport{
        TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
    }
    client := &http.Client{Transport: tr}
    
    // Use the client to make requests
  2. Provide a Valid Certificate: Ensure that the server's certificate is valid and properly configured. You can do this by:

    • Checking the server's certificate expiration date.
    • Verifying that the certificate is issued by a trusted Certificate Authority (CA).
    • Ensuring that the certificate's domain matches the server's domain.
  3. Update Ollama Configuration: If you are using a self-signed certificate, you may need to update the Ollama configuration to trust the certificate. You can do this by setting the --tls-ca flag when running the Ollama command.

    ollama run --tls-ca=/path/to/ca.crt minimax-m2:cloud

Verification

To verify that the fix worked, run the Ollama command again and check for any TLS-related errors.

ollama run minimax-m2:cloud

If you no longer see the tls: failed to verify certificate error, the fix was successful.

Extra Tips

  • Always use a valid certificate in production environments to ensure the security of your connections.
  • If you are using a self-signed certificate, make sure to update the Ollama configuration to trust the certificate.
  • Consider using a tool like curl to test the TLS connection and verify that the certificate is valid.
curl -v https://ollama.com/api/me

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - 💡(How to fix) Fix Ollama fails with TLS error [5 comments, 2 participants]