Venthe / vscode-fauxpilot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when connecting to TLS-enabled endpoint

nickthecook opened this issue · comments

Hi there,

The extension is great! It works well with an HTTP endpoint.

However, I'm hosting the Fauxpilot server in the cloud and I need to access it via HTTPS. I can use the following curl request to get a 200 response and code completions:

curl -s -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"prompt":"def hello","max_tokens":100,"temperature":0.1,"stop":["\n\n"]}' https://my-server-hostname:8443v1/engines/codegen/completions

I took that curl command from the Fauxpilot server docs. I get back this:

{
  "id": "cmpl-ynnnfHJDCfyPTxN1nk5zBGqsblhwQ",
  "model": "codegen",
  "object": "text_completion",
  "created": 1702502561,
  "choices": [
    {
      "text": "(self):\n        return \"Hello World!\"",
      "index": 0,
      "finish_reason": "stop",
      "logprobs": null
    }
  ],
  "usage": {
    "completion_tokens": 11,
    "prompt_tokens": 2,
    "total_tokens": 13
  }
}

When I try to use this VSCode extension, though, the Fauxpilot spinner in the bottom right keeps spinning, and this is printed in the logs:

2023-12-13 16:16:46.850 [error] [Venthe.fauxpilot] provider FAILED
2023-12-13 16:16:46.850 [error] Error: Connection error.
	at m.makeRequest (/Users/nick/.vscode/extensions/venthe.fauxpilot-1.2.0/dist/extension.js:11713:23)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async K.provideInlineCompletions (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:143:56159)

I don't see any request logs in the TLS-terminating reverse proxy on my server.

Does the extension support TLS?

If I put NGINX in debug mode, it looks like there is an SSL handshake failure:

https-proxy  | 2023/12/13 21:41:37 [info] 20#20: *1 peer closed connection in SSL handshake while SSL handshaking, client: 1.2.3.4, server: 0.0.0.0:8443

If I send a plain HTTP request to that port the error message is different, so it seems the extension is trying to use TLS, but it's not working. curl and Firefox accept the TLS cert, so I don't think it's a problem with the cert.

I destroyed the system and redeployed it. Now completions over TLS work. Not a Fauxpilot extension issue!