llm-ls icon indicating copy to clipboard operation
llm-ls copied to clipboard

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

Open FileMagic opened this issue 1 year ago • 6 comments

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.

FileMagic avatar Feb 13 '24 04:02 FileMagic

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

McPatate avatar Feb 13 '24 06:02 McPatate

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

FileMagic avatar Feb 13 '24 15:02 FileMagic

@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.

FileMagic avatar Feb 13 '24 20:02 FileMagic

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]

McPatate avatar Feb 16 '24 16:02 McPatate

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 avatar Mar 08 '24 16:03 FileMagic

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

FileMagic avatar Mar 08 '24 16:03 FileMagic