continue icon indicating copy to clipboard operation
continue copied to clipboard

Continue connection to a local server fails in https

Open YanickNoblanc opened this issue 11 months ago • 9 comments

Hi all

I have setup a local llm on a local server, it is running a vllm (0.11.0) with several models available, an open-webui ( v0.6.40) and a nginx proxy (1.29.3).

I can acces properly my llm through open-webui chat interface at https://server or http://server When configuring Continue VSCode plugin (on Windows) to acces my server through http, it works fine in agent or chat mode and answers my questions.

But when trying to access server in https, I systematicaly get a connection error, Developpers Tools logs: [@continuedev] error: Connection error. {"context":"llm_stream_chat","model":"/models/Llama-3.1-8B-Instruct","provider":"openai","useOpenAIAdapter":true,"streamEnabled":true,"templateMessages":false} I checked the server configuration and certificates are correct. Certificate is signed by our internal CA. Here is Continue config.yaml I am using:

name: Local Config
version: 1.0.0
schema: v1
models:
  - name: Llama-3.1-8B-Instruct
    provider: openai
    model: /models/Llama-3.1-8B-Instruct
    env:
      useLegacyCompletionsEndpoint: false
    apiBase: http://server:8443/v1
    ##TODO https does not work !
    apiKey: AAAAAAAAAAAAAAAAA
    roles:
      - chat
      - edit
      - apply

What should I do for Continue to work with https ?

YanickNoblanc avatar Dec 05 '25 08:12 YanickNoblanc

Related issues about HTTPS/SSL certificate problems with local servers:

Self-signed certificate issues:

  • #1474 - VScode SSL self signed issue (verifySsl not working with self-signed certs)
  • #889 - caBundlePath and verifySsl ignored for openai model
  • #4310 - need to disable ssl verification (Ollama with nginx proxy)
  • #5115 - Trusted self-signed certificate works for chatting but not for auto-completion
  • #5484 - @Jira context: error "self signed certificate in certificate chain" - lost of global requestOptions used in fetch with YAML config

Certificate verification issues:

  • #218 - OpenAIConnectionError probably caused by failed SSL certificates
  • #5578 - Unable to get local issuer certificate failure

Related to open-webui/vllm with HTTPS:

  • #3957 - Can't connect to open-webui API (testing with nginx server and localhost)

These issues all relate to SSL/TLS certificate verification problems when connecting to local or self-hosted servers with HTTPS, particularly with self-signed or internal CA certificates.

continue avatar Dec 05 '25 08:12 continue

Thank you very much for all the information.

YanickNoblanc avatar Dec 05 '25 08:12 YanickNoblanc

Unfortunatly does not give me a clear answar to my problem. The certificate on my server is not self signed. I tried adding requestOptions verifySsl: false and caBundlePath:... : it does not solve my issue. Still getting same communication error.

YanickNoblanc avatar Dec 05 '25 10:12 YanickNoblanc

This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.

github-actions[bot] avatar Mar 06 '26 02:03 github-actions[bot]

Any update? I can confirm the issue

robertschulze avatar Mar 06 '26 21:03 robertschulze

I think this is very likely a Continue TLS handling gap rather than a server-side cert problem.

Why I say that:

  • plain http works for the same endpoint
  • multiple related Continue issues report the same pattern with internal CA / private PKI certs
  • in #5115 and #5484, people reported that caBundlePath, NODE_EXTRA_CA_CERTS, or custom fetch wiring changed behavior, which points at the extension's Node/Electron trust path rather than nginx/vLLM/open-webui itself

A few concrete things that would help narrow it down for maintainers:

  1. Confirm whether this exact URL succeeds from the same machine with a Node-based client, not just browser/curl.

    • browser success is not enough because VS Code extensions do not always use the OS/browser trust path the same way
  2. Try model-level requestOptions explicitly in YAML, for example:

models:
  - name: Llama-3.1-8B-Instruct
    provider: openai
    model: /models/Llama-3.1-8B-Instruct
    apiBase: https://server:8443/v1
    apiKey: AAAAAAAAAAAAAAAAA
    requestOptions:
      caBundlePath: C:\\path\\to\\internal-ca-chain.pem
      verifySsl: true
  1. If that still fails, try NODE_EXTRA_CA_CERTS for the VS Code extension host process. There are older Continue threads where that was the only thing that worked reliably with internal CAs.

  2. Verify the certificate chain and hostname from the extension host's point of view:

    • full chain is served by nginx, not only leaf cert
    • SAN contains the exact hostname used in apiBase
    • no hostname mismatch between server vs FQDN vs IP

My guess is the root issue is one of these:

  • YAML requestOptions not being propagated on this code path
  • extension host fetch path not honoring the Windows trust store / internal CA the same way browser access does
  • incomplete chain from nginx that browsers repair but Node fetch does not

If someone can post the exact TLS error string from the extension host logs, that would probably separate "trust chain" from "hostname/SAN" immediately.

pandego avatar Mar 11 '26 08:03 pandego

This is caused by Node.js not trusting your internal CA. We've verified that requestOptions.caBundlePath does propagate correctly through the YAML config to the HTTPS agent layer — so if it didn't work previously, the likely cause is that the PEM file didn't include the full certificate chain.

To fix this:

  1. Make sure your PEM file contains the full chain (your internal root CA + any intermediates). You can export the full chain with:

    openssl s_client -connect your-server:443 -showcerts < /dev/null 2>/dev/null | openssl x509 -outform PEM > ca-bundle.pem
    
  2. Configure it in your config.yaml:

    requestOptions:
      caBundlePath: /path/to/ca-bundle.pem
    

    Or per-model:

    models:
      - name: my-model
        provider: openai
        requestOptions:
          caBundlePath: /path/to/ca-bundle.pem
    

Alternatively, set the NODE_EXTRA_CA_CERTS environment variable to your CA bundle path.

Full docs: https://docs.continue.dev/troubleshooting#ssl-certificate-errors and https://docs.continue.dev/faqs#configure-certificates

Closing as this is addressable via configuration. Please reopen if the full-chain PEM + caBundlePath still doesn't work — that would indicate a bug we'd want to investigate.

RomneyDa avatar Mar 25 '26 03:03 RomneyDa

I can confirm this doesn't work on VS Code with the extension version 1.2.22 on Linux. I tried the verifySsl and caBundlePath both on models and at the root of the config.yaml and restarting the IDE. I guess I will see how to set NODE_EXTRA_CA_CERTS on my VS Code launcher icon. That environment option NODE_EXTRA_CA_CERTS should be documented on https://docs.continue.dev/troubleshooting#ssl-certificate-errors though, which isn't.

ivanbaldo avatar Apr 01 '26 20:04 ivanbaldo

I did not manage to make it work either. Where should I try setting NODE_EXTRA_CA_CERTS (which menu/interface/file) ?

YanickNoblanc avatar Apr 02 '26 06:04 YanickNoblanc