From 129ea5ed817f1627e31ed1d030900e0814ff6649 Mon Sep 17 00:00:00 2001 From: Philip Lewis Date: Sat, 9 Jun 2018 20:20:47 -0400 Subject: [PATCH] openjdk: fix truststore-from-env patch for jdk10 storePropName will be jsseDefaultStore if the property isn't present, and jsseDefaultStore is never null, so the branch to use the environment variable would never be taken. The env var is supposed to be preferred to jssecacerts, so we can use it as the default in the call to System.getProperty, and use the null check to fall back on jsseDefaultStore instead. --- .../openjdk/read-truststore-from-env-jdk10.patch | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/openjdk/read-truststore-from-env-jdk10.patch b/pkgs/development/compilers/openjdk/read-truststore-from-env-jdk10.patch index b5abc1d794db..6203064f5c06 100644 --- a/pkgs/development/compilers/openjdk/read-truststore-from-env-jdk10.patch +++ b/pkgs/development/compilers/openjdk/read-truststore-from-env-jdk10.patch @@ -8,12 +8,22 @@ * jssecacerts * cacerts */ -@@ -144,6 +145,9 @@ +@@ -132,7 +133,8 @@ + public TrustStoreDescriptor run() { + // Get the system properties for trust store. + String storePropName = System.getProperty( +- "javax.net.ssl.trustStore", jsseDefaultStore); ++ "javax.net.ssl.trustStore", ++ System.getenv("JAVAX_NET_SSL_TRUSTSTORE")); + String storePropType = System.getProperty( + "javax.net.ssl.trustStoreType", + KeyStore.getDefaultType()); +@@ -144,6 +146,9 @@ String temporaryName = ""; File temporaryFile = null; long temporaryTime = 0L; -+ if (storePropName == null){ -+ storePropName = System.getenv("JAVAX_NET_SSL_TRUSTSTORE"); ++ if (storePropName == null) { ++ storePropName = jsseDefaultStore; + } if (!"NONE".equals(storePropName)) { String[] fileNames =