Skip to content

How to use with self-signed certificates? #419

@aramirezreyes

Description

@aramirezreyes

Hi! Thanks for the great tool.

Summary

I am facing an error when using copilot.el . The error has to do with using self-signed certificates, which prevent the communication with copilot.

The error message

This appears in the *copilot-language-server-log whenever the extension tries to communicate with the github servers, it it basically does not work.

[ghostText] Error on ghost text request: FetchError: The pending stream has been canceled (caused by: self-signed certificate in certificate chain)
    at fetch (~/.config/emacs/.cache/copilot/lib/node_modules/@github/copilot-language-server/node_modules/@adobe/helix-fetch/src/fetch/index.js:99:11)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at cachingFetch (~/.config/emacs/.cache/copilot/lib/node_modules/@github/copilot-language-server/node_modules/@adobe/helix-fetch/src/fetch/index.js:288:16)
    at UT.fetch (~/.config/emacs/.cache/copilot/lib/node_modules/@github/copilot-language-server/lib/src/network/helix.ts:94:22)
    at IS.fetchWithParameters (~/.config/emacs/.cache/copilot/lib/node_modules/@github/copilot-language-server/lib/src/openai/fetch.ts:834:26)
    at IS.fetchAndStreamCompletions (~/.config/emacs/.cache/copilot/lib/node_modules/@github/copilot-language-server/lib/src/openai/fetch.ts:528:26)
    at genericGetCompletionsFromNetwork (~/.config/emacs/.cache/copilot/lib/node_modules/@github/copilot-language-server/lib/src/ghostText/ghostText.ts:161:21)
    at ~/.config/emacs/.cache/copilot/lib/node_modules/@github/copilot-language-server/lib/src/ghostText/ghostText.ts:1011:31
    at getGhostText (~/.config/emacs/.cache/copilot/lib/node_modules/@github/copilot-language-server/lib/src/ghostText/ghostText.ts:1155:16)
    at getInlineCompletionsResult (~/.config/emacs/.cache/copilot/lib/node_modules/@github/copilot-language-server/lib/src/inlineCompletion.ts:30:20) {
  type: 'system',
  _name: 'FetchError',
  code: 'ERR_HTTP2_STREAM_CANCEL',
  errno: undefined,
  erroredSysCall: undefined
}
[default] Error sending telemetry FetchError: The pending stream has been canceled (caused by: self-signed certificate in certificate chain)
    at fetch (~/.config/emacs/.cache/copilot/lib/node_modules/@github/copilot-language-server/node_modules/@adobe/helix-fetch/src/fetch/index.js:99:11)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at cachingFetch (~/.config/emacs/.cache/copilot/lib/node_modules/@github/copilot-language-server/node_modules/@adobe/helix-fetch/src/fetch/index.js:288:16)
    at UT.fetch (~/.config/emacs/.cache/copilot/lib/node_modules/@github/copilot-language-server/lib/src/network/helix.ts:94:22) {
  type: 'system',
  _name: 'FetchError',
  code: 'ERR_HTTP2_STREAM_CANCEL',
  errno: undefined,
  erroredSysCall: undefined
}

What I have tried.

  1. I tried installing the mac-ca certificates from here https://github.com/jfromaniello/mac-ca into the node version used by copilot.el
  2. Then I modified ~/.config/emacs/.cache/copilot/lib/node_modules/@github/copilot-language-server/dist/language-server.js
    By adding this to the shebang #!/usr/bin/env node --require mac-ca/register

But unfortunately no luck. Do you have any pointers for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions