Skip to content
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

Install rust failed with openssl errors #3995

Closed
2 tasks done
hoverwinter opened this issue Aug 19, 2024 · 12 comments
Closed
2 tasks done

Install rust failed with openssl errors #3995

hoverwinter opened this issue Aug 19, 2024 · 12 comments
Labels
not-rustup Whatever is described in this issue isn't Rustup's fault

Comments

@hoverwinter
Copy link

Verification

Problem

image

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

info: downloading installer
Auto configuration failed
8454617792:error:02FFF001:system library:func(4095):Operation not permitted:/AppleInternal/Library/BuildRoots/ce725a5f-c761-11ee-a4ec-b6ef2fd8d87b/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/crypto/bio/bss_file.c:122:fopen('/private/etc/ssl/openssl.cnf', 'rb')
8454617792:error:20FFF002:BIO routines:CRYPTO_internal:system lib:/AppleInternal/Library/BuildRoots/ce725a5f-c761-11ee-a4ec-b6ef2fd8d87b/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/crypto/bio/bss_file.c:127:
8454617792:error:0EFFF002:configuration file routines:CRYPTO_internal:system lib:/AppleInternal/Library/BuildRoots/ce725a5f-c761-11ee-a4ec-b6ef2fd8d87b/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/crypto/conf/conf_def.c:202:

Steps

Just use script on mac

Possible Solution(s)

No response

Notes

No response

Rustup version

*

Installed toolchains

*

OS version

Apple M3 Pro
macOS 14.4.1 23E224
@djc
Copy link
Contributor

djc commented Aug 19, 2024

What does which curl say, and curl -V? It looks like your curl is using libressl, which definitely seems non-standard? My curl (on macOS 14.5) is /usr/bin/curl which seems to use SecureTransport.

@5101good
Copy link

installed already, when i run rustup, same error showup:
Auto configuration failed 8573795008:error:02FFF001:system library:func(4095):Operation not permitted:/AppleInternal/Library/BuildRoots/ce725a5f-c761-11ee-a4ec-b6ef2fd8d87b/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/crypto/bio/bss_file.c:122:fopen('/private/etc/ssl/openssl.cnf', 'rb') 8573795008:error:20FFF002:BIO routines:CRYPTO_internal:system lib:/AppleInternal/Library/BuildRoots/ce725a5f-c761-11ee-a4ec-b6ef2fd8d87b/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/crypto/bio/bss_file.c:127: 8573795008:error:0EFFF002:configuration file routines:CRYPTO_internal:system lib:/AppleInternal/Library/BuildRoots/ce725a5f-c761-11ee-a4ec-b6ef2fd8d87b/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/crypto/conf/conf_def.c:202:

@rami3l
Copy link
Member

rami3l commented Oct 14, 2024

installed already, when i run rustup, same error showup: Auto configuration failed 8573795008:error:02FFF001:system library:func(4095):Operation not permitted:/AppleInternal/Library/BuildRoots/ce725a5f-c761-11ee-a4ec-b6ef2fd8d87b/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/crypto/bio/bss_file.c:122:fopen('/private/etc/ssl/openssl.cnf', 'rb') 8573795008:error:20FFF002:BIO routines:CRYPTO_internal:system lib:/AppleInternal/Library/BuildRoots/ce725a5f-c761-11ee-a4ec-b6ef2fd8d87b/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/crypto/bio/bss_file.c:127: 8573795008:error:0EFFF002:configuration file routines:CRYPTO_internal:system lib:/AppleInternal/Library/BuildRoots/ce725a5f-c761-11ee-a4ec-b6ef2fd8d87b/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/crypto/conf/conf_def.c:202:

@5101good I believe you're not using the system-provided curl distribution. What does which curl give on your machine?

@5101good
Copy link

Image
OS version
Apple M3 Pro
macOS 14.4.1 23E224
I am upgrading macOS to 15.0.1, I will update its effect later.

@5101good
Copy link

installed already, when i run rustup, same error showup: Auto configuration failed 8573795008:error:02FFF001:system library:func(4095):Operation not permitted:/AppleInternal/Library/BuildRoots/ce725a5f-c761-11ee-a4ec-b6ef2fd8d87b/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/crypto/bio/bss_file.c:122:fopen('/private/etc/ssl/openssl.cnf', 'rb') 8573795008:error:20FFF002:BIO routines:CRYPTO_internal:system lib:/AppleInternal/Library/BuildRoots/ce725a5f-c761-11ee-a4ec-b6ef2fd8d87b/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/crypto/bio/bss_file.c:127: 8573795008:error:0EFFF002:configuration file routines:CRYPTO_internal:system lib:/AppleInternal/Library/BuildRoots/ce725a5f-c761-11ee-a4ec-b6ef2fd8d87b/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/crypto/conf/conf_def.c:202:

@5101good I believe you're not using the system-provided curl distribution. What does which curl give on your machine?

I consulted chatGPT, and on macOS, curl is configured to use ressl by default under Apple's settings. But this is not the issue; I don't know why those configuration files cannot be read.

@rami3l
Copy link
Member

rami3l commented Oct 14, 2024

But this is not the issue; I don't know why those configuration files cannot be read.

@5101good I hear you. Indeed, /usr/bin/curl is the official distribution, but I still believe there's more to this issue.

How about setting OPENSSL_CONF=/etc/ssl when running the script? Since your cURL distribution's LibreSSL is (regardless of it being bundled or not) configured to read from /private/etc/ssl/ and failed, I doubt it's not in its default state.

Here's my wild guess: a certain .pkg you've installed has modified this state without you even knowing it...

Possibly related:

@rami3l
Copy link
Member

rami3l commented Oct 14, 2024

To clarify, /private/etc/ssl is the default config path for the bundled LibreSSL on macOS:

> /usr/bin/openssl version -d
OPENSSLDIR: "/private/etc/ssl"

... but open() with "rb" shouldn't fail since it's on .rw-r--r--@ by default:

> eza -lah /private/etc/ssl
Permissions Size User Date Modified Name
.rw-r--r--@ 333k root  1 Oct 12:10  cert.pem
drwxr-xr-x     - root  1 Oct 12:10  certs
.rw-r--r--@  745 root  1 Oct 12:10  openssl.cnf
.rw-r--r--@ 1.0k root  1 Oct 12:10  x509v3.cnf

@5101good
Copy link

thanks for your help. My config options are same with you, but still has this issue.

@5101good
Copy link

5101good commented Oct 14, 2024

good news, when i upgrade macOS to V15, still fail. Then a popup window remind me update cmd line tools, when update complete, rustup can start normal now. I cannot make sure its apple's compatibility or some mistake i did before. Hope this information is useful to others who come across

@5101good
Copy link

I am finally stepping into the world of Rust now😂

@rami3l
Copy link
Member

rami3l commented Oct 16, 2024

good news, when i upgrade macOS to V15, still fail. Then a popup window remind me update cmd line tools, when update complete, rustup can start normal now. I cannot make sure its apple's compatibility or some mistake i did before. Hope this information is useful to others who come across

Nice to hear! So it sounds like the solution is to install Xcode Command Line Tools?

Anyway, it looks like I can safely close this issue now, as I'm certain it has something to do with macOS' state rather than our codebase. Thanks a lot for sharing @5101good!

@rami3l rami3l closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2024
@rami3l rami3l added not-rustup Whatever is described in this issue isn't Rustup's fault and removed bug labels Oct 16, 2024
@sukhmel
Copy link

sukhmel commented Dec 23, 2024

I'm experiencing the same issue when installing it with Nix and there is no xcode update pending, but I will try to reinstall it then

Update 1: looks like this was because I had xcode that was too fresh, I followed the instructions to get all available versions:

    xclt_tmp="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"
    /usr/bin/touch "${xclt_tmp}"
    softwareupdate --list --all
    softwareupdate -i "Command Line Tools for Xcode-15.3" # from the output of the previous line

I only checked clang version but it changed down, so I assume, everything else was downgraded, too. My machine is managed by centralised policy, and this seems to confuse Xcode, as this is not the first time something breaks because the installed SDK or something else related to cmd line tools is for the next OS version

Update 2: still same error, just after longer, that's why I thought it was fixed.

Update 3: looks like it's same as nix-community/fenix#178, which is likely same as oxalica/rust-overlay#149 but the latter should've been fixed at the start of the year

Update 4: in case anyone will stumble upon it, I was unable to solve it, and worked around by disabling sandboxing --option sandbox false

Update 5: after I successfully switched generation, I tried to turn sandbox back on and it works. Maybe it is because of how sandboxing is implemented, or maybe it was because of some garbage uncollected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-rustup Whatever is described in this issue isn't Rustup's fault
Projects
None yet
Development

No branches or pull requests

5 participants