serayuzgur / crates

crates is an extension aims to help people to manage their dependencies for rust (crates.io & TOML).
https://marketplace.visualstudio.com/items?itemName=serayuzgur.crates
MIT License
238 stars 37 forks source link

SSL Error when attempting to reach registry on MacOS #208

Closed caass closed 1 year ago

caass commented 1 year ago

Describe the bug crates errors when checking for crate information on MacOS

To Reproduce Steps to reproduce the behavior:

  1. Create a new project with cargo new crates-test
  2. cd into the directory and add a dependency, any dependency should work (e.g. cargo add eyre)
  3. Open the project in VS Code
  4. Open the project's Cargo.toml and save it, if necessary

Expected behavior The extension is able to fetch data from the crate registry and display information.

Screenshots

Screenshot 2023-08-28 at 10 39 18 PM
Full text: ``` Completed with errors tauri-build: Error: write EPROTO 48344152495112:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:231: directories: Error: write EPROTO 48344152495112:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:231: serde: Error: write EPROTO 48344152495112:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:231: serde_json: Error: write EPROTO 48344152495112:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:231: tauri: Error: write EPROTO 48344152495112:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:231: typeshare: Error: write EPROTO 48344152495112:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:231: ```

Desktop (please complete the following information):

Additional context This has occurred on previous versions of MacOS as well. Let me know if there's a way I can provide better steps to reproduce, it seems like it could be something with my install specifically.

BarbossHack commented 1 year ago
caass commented 1 year ago
  • do you have a proxy or VPN ?

I do have one installed, but not active. I double checked my certs and didn't see anything out of the ordinary.

  • check in you vscode settings.json for settings starting with "crates.", and paste it here if there is any

No dice :(

It does not :/ it just hangs forever

  • if you have curl installed, could you run curl -v https://api.crates-vsc.space/index/versions/bson and paste the output here ?
❯ curl -v https://api.crates-vsc.space/index/versions/bson
*   Trying 18.204.152.241:443...
* Connected to api.crates-vsc.space (18.204.152.241) port 443 (#0)
* ALPN: offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* Recv failure: Operation timed out
* LibreSSL/3.3.6: error:02FFF03C:system library:func(4095):Operation timed out
* Closing connection 0
curl: (35) Recv failure: Operation timed out

Another bizarre thing is that it only doesn't work most of the time -- periodically, around once per day or so? Traffic gets through successfully.

BarbossHack commented 1 year ago

Well, this is strange

If you check on dnschecker.org for api.crates-vsc.space it resolve to 24.199.121.34, which is DigitalOcean, where the API server is really hosted

In your curl output, I can see that you resolve to 18.204.152.241, an AWS (amazon) address, which has nothing to do with DigitalOcean...

Do you have any custom DNS resolver ? What is you Internet Provider and in which country ?

caass commented 1 year ago

Hmm...it did wind up being something with VPN. I'll close this out. Thanks for troubleshooting!