huggingface / llm-ls

LSP server leveraging LLMs for code completion (and more?)
Apache License 2.0
602 stars 49 forks source link

Use rustls-tls-native-roots to allow for OS cert stores for rustls #77

Open FileMagic opened 7 months ago

FileMagic commented 7 months ago

following the discussion in https://github.com/huggingface/llm-ls/issues/36#issuecomment-1771185733 I realized we can use the rustls-tls-native-roots which says: "Enables TLS functionality provided by rustls, while using root certificates from the rustls-native-certs crate."

The rustls-native-certs "Integration with OS certificate stores for rustls." So it should allow for you to use the root certs from your host. Which should fix our issue from issue https://github.com/huggingface/llm-ls/issues/36.

McPatate commented 7 months ago

Lgtm, could you update llm-ls' version in its Cargo.toml to 0.5.2?

FileMagic commented 7 months ago

I also need to test this, but I did pull down your changes.

FileMagic commented 7 months ago

@McPatate just to make sure I did this correctly I saw ya'll were using xtask so I ran a cargo xtask dist. I then set the llm.lsp.binaryPath to be <path_to_llm_ls_repo>/target/debug/llm-ls in vscode to be the bin I compiled. Then tried an cert I generated for an proxy I made that used a self generated tls cert trusted by the host.

This is all different than what is stated here.

So I wanted to make sure that this was fine. However, everything seemed to work.

McPatate commented 7 months ago

cargo xtask dist is used to build llm-ls to be bundled with the vscode extension. I'm not even sure why it worked, I thought it build in release mode only 🤔

Either way, if it works for you this is the same as running cargo build [-r]

FileMagic commented 7 months ago

Well I see that I made a mistake 3 weeks ago when I was writing this comment. it was not debug it was release. However, yeah this seemed to work for me as a fix for the self signed tls certs. I apologize for the delay.

FileMagic commented 7 months ago

Let me know if there is anything else needed for this.