Repository navigation
Open
Labels
0.kind: bugSomething is broken
Description
Nixpkgs version
- Unstable (26.05)
Describe the bug
openssl does not use the config at /etc/ssl/openssl.cnf but instead uses a built in config. This is an issue as soon as one wants to change said config. Though it technically possible through the conf override, doing so triggers a mass rebuild that beyond anything that is reasonable or even feasible (for me it was 3000+ packages that take several tens of hours on 8 builders, plus several dependencies failing to build at all).
Steps to reproduce
~$ strace openssl list -providers 2>&1 | grep etc
access("/etc/ld-nix.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/61i74yjkj9p1qphfl7018ja4sdwkipx0-openssl-3.6.0/etc/ssl/openssl.cnf", O_RDONLY) = 3Expected behaviour
Openssl should read /etc/ssl/openssl.cnf
Screenshots
No response
Relevant log output
Additional context
No response
System metadata
- system:
"x86_64-linux" - host os:
Linux 6.18.1, NixOS, 26.05 (Yarara), 26.05.20251217.af84f9d - multi-user?:
yes - sandbox:
yes - version:
nix-env (Lix, like Nix) 2.93.3 System type: x86_64-linux Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/void/.config/nix/nix.conf:/nix/store/lpf46bniz5m04p9w21rcnqdnp170hsqy-stylix-kde-config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/void/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/void/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/void/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/w7x0993gjpy31k5v5xklnqmd8q0br8h0-lix-2.93.3/share - nixpkgs:
/nix/store/krhf9igjyi7h8c5mlddxd8fhwv1ljmzm-source
Notify maintainers
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
- I assert that this is a bug and not a support request.
- I assert that this is not a duplicate of an existing issue.
- I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a 👍 reaction to issues you find important.
Reacted by cyclohexane, Martin Weinelt, Logical Overflow, merspieler, Commentator2.0, kloenk, PancakeTAS, Pilz, Peanutbother, Atemu and 1 more
Metadata
Metadata
Assignees
Labels
0.kind: bugSomething is broken
Activity
IncredibleLaser commentedon Dec 19, 2025
I haven't tried this yet, but it might be easier to do something like
https://search.nixos.org/options?channel=unstable&query=replaceDependencies
497a commentedon Dec 20, 2025
While this of course works, it is not quite a solution but rather a work around if the goal is to modify the global openssl config. Furthermore I don't think it is reasonable having to do that for every relevant package when there should be a much more straight forward option.
Another plus of being able to use the config at /etc/ssl would be the possibility of introducing a nixos option for configuring openssl, the file format seems to be INI.
IncredibleLaser commentedon Dec 20, 2025
This setting is system-wide, not per package.
497a commentedon Dec 20, 2025
In that case I could surely try that but I would expect the same to happen. My other points still stand though; it's not a solution but rather a workaround.
Atemu commentedon Dec 20, 2025
replaceDependencies also uses IFD wich is not great in general and undesirable in many cases.
Atemu commentedon Dec 20, 2025
I think we should investigate:
Atemu commentedon Dec 20, 2025
The ancient runes speak of mystical
OPENSSL_CONFenvironmental magic. Have you tried that?https://github.com/openssl/openssl/blob/d78e642f288a38a057b242ef481914deeead7b6c/crypto/conf/conf_mod.c#L644-L652
thillux commentedon Dec 20, 2025
What are you trying to achieve with this global config? I'd like to understand your problem first. I also use another OpenSSL config, but only for a small amount of packages, where I'm totally ok with replacing the OpenSSL input with my overriden one and rebuilding them. A global
/etc/ssl/openssl.cnfalso does not work with e.g. different OpenSSL versions in parallel in the nix store, which should pick up different settings. I'd like to keep this config out of a global path if possible IMHO.Atemu commentedon Dec 21, 2025
That's a good point.
Though is it really the case that settings for a newer OpenSSL would break older ones (or vice versa)?
marcin-serwin commentedon Jan 17, 2026
Needing to rebuild a package just to change its runtime config is an unusual convention. Generally, packages in nixpkgs respect the files in
/etcand use modules to aid in configuration and reproducibility. The package is already not perfectly pure as it's patched to use the certificates from/etc.If that's the main concern then perhaps we could restrict only the legacy 1.1 and 3.0 versions and let the main one use the system-wide config?
Atemu commentedon Mar 4, 2026
The trouble here is that openssl isn't a regular package that you explicitly configure yourself an instance of to run on your system but rather a library you implicitly use by using (practically) any program that does crypto.
A file in /etc therefore becomes global configuration state for nearly any application you will run and we should avoid such global state wherever possible.
The cert bundle is a standardised format with a very small set of possible variances. The openssl config file is most certainly not.
The trouble is that, should there be a openssl 4.0 that breaks config file ABI, apps compiled against our 3.0 will break.
Could anyone with a use-case for openssl config please try whether the env var I found can be used to control it? That would solve this issue as env vars are easy enough to scope for any use-case.
andrewzah commentedon May 26, 2026
@Atemu
Yes,
OPENSSL_CONF=/path/to/custom/openssl.cnfis the standard way of doing this. Confirm withman openssl-envandman config.Pointing to a global config would only have downsides, in addition to the "rebuilding the world" problem that comes with changing the openssl derivation.
Atemu commentedon May 27, 2026
@497a could you test whether using an env var works for you? :3