about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/openjdk/read-truststore-from-env-jdk8.patch
blob: 08cf554a18fecb6d4b1445da408af79ecc9a8ca4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- a/jdk/src/share/classes/sun/security/ssl/TrustStoreManager.java	2017-06-26 21:48:25.000000000 -0400
+++ b/jdk/src/share/classes/sun/security/ssl/TrustStoreManager.java	2017-07-05 20:45:57.491295030 -0400
@@ -71,6 +71,7 @@
      *
      * The preference of the default trusted KeyStore is:
      *    javax.net.ssl.trustStore
+     *    system environment variable JAVAX_NET_SSL_TRUSTSTORE
      *    jssecacerts
      *    cacerts
      */
@@ -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 = jsseDefaultStore;
+                    }
                     if (!"NONE".equals(storePropName)) {
                         String[] fileNames =
                                 new String[] {storePropName, defaultStore};