Skip to content

Unable to connect to the API maybe due to the self-signed certificate #10926

@NGC13009

Description

@NGC13009

Before submitting your bug report

Relevant environment info

- OS: Windows 11 pro 
- Continue version: 1.2.16
- IDE version: 1.106.3
- Model: -
- config: 
  
  - name: -
    provider: openai
    model: qwen2.5-coder:7b
    capabilities: [tool_use]
    apiBase: https://......../v1
    apiKey: ....
    roles:
      - chat
      - edit
      - autocomplete
      - apply
      - summarize
    defaultCompletionOptions:
      contextLength: 6144
      maxTokens: 2048
    requestOptions:
      verifySsl: false

Description

I have an API that uses a self-signed certificate, and I have already installed the root certificate of this certificate on the Windows system.

However, Node.js does not seem to want to use the system certificates for some reason.... When I send a request to the API, an error is thrown and the API cannot be used normally.

I have checked the logs, including the developer debug window in VS Code (i.e., the JS logs), but there is no more useful information available—only one message: "Connect Error." That’s all there is.

Nevertheless, the API works fine when I send HTTP requests. Once I switch to HTTPS (TLS/SSL), an error is triggered.
I have tried the following solutions:

  1. Setting system environment variables to force Node.js to use system certificates
  2. Specifying the path to system certificates for Node.js (via configurations in VS Code)
  3. Disabling SSL verification in the configuration file of Continue
  4. Replacing the OpenAI interface with the Ollama interface (a server I deployed myself, with Ollama as the backend)—this still didn’t work, though the error message changed to: "Failed to verify the root certificate of the SSL certificate," even after I tried the above steps.
  5. Directly requesting the same URL via curl works normally, so there is no issue with the API backend.

To reproduce

  1. Deploy an OpenAI-style API with a self-signed certificate
  2. Configure Continue
  3. Attempt to have a conversation (with the API)

Log output

[Extension Host] [@continuedev] error: Connection error. {"context":"llm_stream_chat","model":"qwen2.5-coder:7b","provider":"openai","useOpenAIAdapter":true,"streamEnabled":true,"templateMessages":false}
workbench.desktop.main.js:sourcemap:528 [Extension Host] Error: Connection error.
	at OpenAI.makeRequest (c:\Users\ngc13\.vscode\extensions\continue.continue-1.2.16-win32-x64\out\extension.js:177721:17)
	at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
	at async OpenAIApi.chatCompletionStream (c:\Users\ngc13\.vscode\extensions\continue.continue-1.2.16-win32-x64\out\extension.js:181539:26)
	at async OpenAI2.openAIAdapterStream (c:\Users\ngc13\.vscode\extensions\continue.continue-1.2.16-win32-x64\out\extension.js:304704:26)
	at async OpenAI2.streamChat (c:\Users\ngc13\.vscode\extensions\continue.continue-1.2.16-win32-x64\out\extension.js:304840:32)
	at async llmStreamChat (c:\Users\ngc13\.vscode\extensions\continue.continue-1.2.16-win32-x64\out\extension.js:816016:19)
	at async Wd.handleMessage [as value] (c:\Users\ngc13\.vscode\extensions\continue.continue-1.2.16-win32-x64\out\extension.js:854405:29)
workbench.desktop.main.js:sourcemap:36   ERR [Extension Host] Error handling webview message: {
  "msg": {
    "messageId": "70740b59-a098-41f7-87a6-bf1217fb07d7",
    "messageType": "llm/streamChat",
    "data": {
      "completionOptions": {
        "reasoning": false
      },
      "title": "LLLMqwen",
      "messages": [
        {
          "role": "system",
          "content": "....."
        },
        {
          "role": "user",
          "content": "hello"
        }
      ],
      "messageOptions": {
        "precompiled": true
      }
    }
  }
}

Error: Connection error.
error @ workbench.desktop.main.js:sourcemap:36
error @ workbench.desktop.main.js:sourcemap:36
error @ workbench.desktop.main.js:sourcemap:3828
mCs @ workbench.desktop.main.js:sourcemap:528
$logExtensionHostMessage @ workbench.desktop.main.js:sourcemap:528
S @ workbench.desktop.main.js:sourcemap:3869
Q @ workbench.desktop.main.js:sourcemap:3869
M @ workbench.desktop.main.js:sourcemap:3869
L @ workbench.desktop.main.js:sourcemap:3869
(匿名) @ workbench.desktop.main.js:sourcemap:3869
C @ workbench.desktop.main.js:sourcemap:29
fire @ workbench.desktop.main.js:sourcemap:29
fire @ workbench.desktop.main.js:sourcemap:561
l.onmessage @ workbench.desktop.main.js:sourcemap:3880
workbench.desktop.main.js:sourcemap:528 [Extension Host] Error handling webview message: {
  "msg": {
    "messageId": "70740b59-a098-41f7-87a6-bf1217fb07d7",
    "messageType": "llm/streamChat",
    "data": {
      "completionOptions": {
        "reasoning": false
      },
      "title": "LLLMqwen",
      "messages": [
        {
          "role": "system",
          "content": "....."
        },
        {
          "role": "user",
          "content": "hello"
        }
      ],
      "messageOptions": {
        "precompiled": true
      }
    }
  }
}

Error: Connection error.
gCs @ workbench.desktop.main.js:sourcemap:528
$logExtensionHostMessage @ workbench.desktop.main.js:sourcemap:528
S @ workbench.desktop.main.js:sourcemap:3869
Q @ workbench.desktop.main.js:sourcemap:3869
M @ workbench.desktop.main.js:sourcemap:3869
L @ workbench.desktop.main.js:sourcemap:3869
(匿名) @ workbench.desktop.main.js:sourcemap:3869
C @ workbench.desktop.main.js:sourcemap:29
fire @ workbench.desktop.main.js:sourcemap:29
fire @ workbench.desktop.main.js:sourcemap:561
l.onmessage @ workbench.desktop.main.js:sourcemap:3880
workbench.desktop.main.js:sourcemap:3880 Extension Host
workbench.desktop.main.js:sourcemap:3880 [@continuedev] error: Connection error. {"context":"llm_stream_chat","model":"qwen2.5-coder:7b","provider":"openai","useOpenAIAdapter":true,"streamEnabled":true,"templateMessages":false}

Metadata

Metadata

Labels

area:configurationRelates to configuration optionside:vscodeRelates specifically to VS Code extensionkind:bugIndicates an unexpected problem or unintended behavioros:windowsHappening specifically on Windows

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions