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

Java and Nix(OS) - how to openjdk trust? #62

Open
con-f-use opened this issue Jan 19, 2024 · 1 comment
Open

Java and Nix(OS) - how to openjdk trust? #62

con-f-use opened this issue Jan 19, 2024 · 1 comment

Comments

@con-f-use
Copy link

I'm having a hard time adding extra certificates to the java cert store. I'm not sure where openjdk (nix expression) get's its trust from, except that there is an environment variable patch for JAVAX_NET_SSL_TRUSTSTORE.

The usual NixOS option security.pki.certificateFiles doesn't seem to effect openjdk and I'd like to avoid overriding pkgs.cacert as that would probably rebuild half the world.

In the non-nix realm, one would do something like keytool -keystore cacerts -storepass changeit -noprompt -trustcacerts -importcert -alias <SOMENAME> -file <SOME_CERT_FILE>, which comes with Java, but that gives a keytool error: java.io.FileNotFoundException: cacerts (Read-only file system) because it's probably in the read-only nix store.

So my questions are:

  • Where is the openjdk trust store located in nix?
  • How can I add trust?
  • What would be useful to know about Java and Nix(OS)?
@con-f-use con-f-use changed the title java openjdk trust Java and Nix(OS) - how to openjdk trust? Jan 19, 2024
@con-f-use
Copy link
Author

con-f-use commented Jan 19, 2024

I think https://discourse.nixos.org/t/custom-ssl-certificates-for-jdk/18297/11 has the answer, maybe. Maybe the topic should be "Trust in general under NixOS, knowledgedump of Silvan and others".

Another fun fact: I didn't know internal NixOS options like security.pki.installCACerts existed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant