-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"SSL connect error" on Windows #2464
Comments
Do you have any other firewalls or antivirus programs in play? We use WinHTTP so whether or not curl works locally is likely a red herring. |
Sadly, http.cainfo doesn't work on Windows MSYS2. |
@pffang oh I think that's because on Windows you can't actually specify a custom certificate for a secure connection, the system root trust store must be modified. I think curl may actually just ignore that option on Windows... |
@alexcrichton Em...But the custom certificate what is used in my Ubuntu machine was exported from 'Trusted Root Certification Authorities' of my Windows machine. |
@pffang oh dear! In that case I think libcurl should work, although I don't know why it wouldn't :( Unless maybe some other certificate is being negotiated? |
In general the way cargo is surfacing connection related issues is really frustrating. I've just spent 2+ hours banging my head trying to figure out what is going wrong with my Proxy (I think my problem might have something to do with NTLM... maybe? still not really sure). |
@nugend unfortunately I think these errors are originating from libcurl and we're not getting much more from the library currently. Do you have the ability to try a dev version of Cargo though? Doing some digging I found another option in libcurl which may help us extract more information. |
I've updated the libcurl Rust bindings, and if you can give #3137 a whirl it'd be valuable to see if that has an impact here! I know libcurl errors also can come from libgit2, and I want to make sure we're not accidentally losing information there as well. |
@alexcrichton I'll see what I can do, but (please correct me if I'm wrong): Don't I need to be able to have cargo download dependencies in order to build cargo? |
Update curl to track more error info This hopefully will help out with #2464 (comment) by including alexcrichton/curl-rust@07323ab which should give us more information from libcurl
So I actually managed to figure out my problem (the cert chain for the proxy was separate from the global cert chain and they needed to be combined correctly). But I did just try the nightly version with the correct configs removed (tried stepping through a few of the scenarios I was trying to fix it with) Some of the error messages are definitely better. The error message that I was getting stuck on (60) isn't really better at all though (basically, not knowing which peer certificate can't be authenticated makes it very confusing about what's going on and the curl error text doesn't report jack shit about that. I'm also honestly confused about how the curl command line is finding certificates that work with the proxy, but that's got nothing to do with Cargo). Still, it's definitely a net win in terms of making it easier to diagnose why some of the failures are happening. The only additional suggestion I would make here is that it would be helpful to indicate that the error code reported is a libcurl error code. |
Awesome, thanks for the update @nugend! |
I have a similar problem on Windows 7
a. I'm not behind proxy (I also try with another connection) What can I try now? |
@drazde that looks like it may be a local configuration issue? Do you have a custom CA installed? Docs like this I found on google suggest something along the lines of:
(probably changing the specifics depending on your local setup) |
@alexcrichton thanks for your answer!. I try to execute the command that you explain, but it give me this:
Seem the CRLFlags doesn't exists !?! |
|
@drazde yeah I'm not so sure myself, I just found that via googling. The error you're seeing seems specifically related to revocations, though. |
@alexcrichton yes seems my computer can't verify if the certificate is still valid or not. My computer is part of a domain, I don't know if this can change something |
My guess is that something is slightly nonstandard because it works most of the time elsewhere on Windows, but unfortunately I'm not sure what :( |
I'm getting these errors too. I don't know what the mechanism is, but while the internet does not think I'm on a proxy, all(?) the ssl certs that come in are getting rewritten as signed by I tried adding a "=== BEGIN TRUSTED CERT ===" of the |
@JasonKleban in theory at least Cargo is using schannel everywhere for SSL connections, which should use the default Windows certificate store (I believe). Could you gist the full error you're seeing though? |
This is all of it. |
This is maybe a bug in how we're using libcurl? Or maybe a bug in how libcurl interacts with schannel (the system SSL library on Windows)? Or maybe a bug in Cargo itself? Unfortunately I'm not sure what's going on here. We should be using the system defaults, so if we're not there's a bug somewhere and I don't really know what's up |
This mailing list message seems relevant, notably:
So we may just need to add a binding to this in curl-rust and then configure that in Cargo. |
@JasonKleban or @drazde, would you have the ability to test out a custom build of Cargo? |
If possible, I've uploaded a local build of Cargo which supports the options mentioned above. You can add this to [http]
check-revoke = false |
Ooh wow @alexcrichton, great! Thanks man |
Working for me too! Thanks! Is bypassing this check the right thing to do? Is it that the firewall cert is setup improperly and can't be evaluated for a revocation? What I heard was that this was an issue with schannel integration. |
@JasonKleban I believe so, yes, that option is just telling schannel to bypass revocation entirely. Beyond that though I don't know if it's a local configuration problem or what it would be indicative of :( |
Hi Alex, Downloading regex v0.1.80 Caused by: can you explain what's file type under config folder, i have added below now i am geting error Caused by: Can you please help urgently |
@aiodsunil oh dear that sounds bad! Out of curiosity, can you visit crates.io in a web browser? (or github.com?) The configuration error seems quite odd as well, is there perhaps some local filesystem permissions error? |
look like some permission issue .i also truned off SSL but it's still giving the issue not sure what i need to do further, i am able to build/run rust program without dependnecies |
i am still eting below error Caused by: Can someone help please not able to progress |
@aiodsunil that error message seems to indicate that your system is not trusting the certificate from crates.io (or maybe github.com, I'm not sure). This can happen if you've got a firewall that's intercepting TLS communication and isn't properly configured to be trusted on your local system. Beyond that though it's tough to diagnose from just the information you've gisted. |
now this issue resolved after created config file under ./cargo folder and putted below line |
Sounds like all instances on this issue have been solved, so I'm closing this. Please open new issues if this happens again in the future! |
I'm currently trying to work through the exercises on exercism.io.
Based on the suggestions in the above conversation I added the following lines to the that exercises Cargo.toml, the config file eventually looks like this:
I re-ran the command within the project structure and I ended up getting the same error message again. Also, I see that people have mentioned place the configuration file within .cargo/ folder. Some clarifications would be nice here:
Any help would be appreciated here. While installing these particular crates is not essential now, if I cant resolve this issue I wont be able to install any other crates in the future as well. Thanks in advance! cc: @alexcrichton |
So I went on the IRC channel and got cargo to work. Looks like the config file has no extensions and is to be actually called "config". Mistake on my part since I saw that the format was toml and hence would require an extension of ".toml". Also, I assumed ".cargo\config", meant a folder config inside .cargo. Thanks for the help anyways. |
@brunoxti Hi, I have tried as you have suggested, it is still not allowing me to download any dependency. But it does work without quotations. |
I tried to set And finally, I changed the curl in path (I have multi curl in path), and it worked now. C:\Users\Liu.D.H>cargo install mdcat -vvv
Updating `https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git` index
Downloading crates ...
warning: spurious network error (2 tries remaining): [35] SSL connect error (schannel: failed to receive handshake, SSL/TLS connection failed)
warning: spurious network error (1 tries remaining): [35] SSL connect error (schannel: failed to receive handshake, SSL/TLS connection failed)
error: failed to download from `https://crates.io/api/v1/crates/mdcat/0.22.1/download`
Caused by:
[35] SSL connect error (schannel: failed to receive handshake, SSL/TLS connection failed)
C:\Users\Liu.D.H>set path=C:\Windows\System32;%path%
C:\Users\Liu.D.H>where curl
C:\Windows\System32\curl.exe
C:\ProgramData\chocolatey\bin\curl.exe
C:\Users\Liu.D.H\scoop\shims\curl.exe
C:\msys64\usr\bin\curl.exe
C:\Users\Liu.D.H>cargo install mdcat -vvv
Updating `https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git` index
Downloading crates ...
Downloaded mdcat v0.22.1 (registry `https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git`)
Installing mdcat v0.22.1
Downloading crates ...
Downloaded anyhow v1.0.36 (registry `https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git`)
。...... |
I'm having the same probably as the person above. I tried creating ~/.config/config.toml, ~/my-rust-project/.cargo/config.toml, and ~/my-rust-project/.cargo/config files, all with
.. and I still get this error.
This is what comes up when I use 'where curl' like the person above.
I'm using MSYS UCRT64 if that helps. Thank y'all in advance. |
try
Also, please open a new issue instead of commenting on one closed 7 years ago. |
Thanks for the quick response. I've tried that (~/.config/config.toml, ~/my-rust-project/.cargo/config.toml, and ~/my-rust-project/.cargo/config) and no dice. I'm working on a new issue right now. |
I am currently building servo on Windows 10 Pro, version 1511 (64-bit), with msys2 (64-bit) and inside the MinGW-w64 shell, and I get the following error message:
Which is strange as curl works without problems (with redirection):
I even tried to disable the Windows firewall completely, still with the same result (also that would not explain why curl works and cargo does not).
I would appreciate if someone could name a few options to get a more verbose output from cargo (more verbose than
--verbose
).The text was updated successfully, but these errors were encountered: