You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 51525d7
Browse filesBrowse the repository at this point in the historyBrowse files
authored
Refresh filesystem certificates when loading the Key Vault JCA keystore (#50872)
Copy file name to clipboardExpand all lines: sdk/keyvault/azure-security-keyvault-jca/CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@
8
8
9
9
### Bugs Fixed
10
10
11
+
- Reload filesystem certificates from the configured custom and well-known directories when a keystore is constructed or loaded, without sharing mutable filesystem certificate state between keystores.
| Well-Known Certificate | The file path to the well-known certificate|`System.setProperty("azure.cert-path.well-known", "<well-known-certificate-file-path>")]`|
560
-
| Custom Certificate | The file path to the custom certificate|`System.setProperty("azure.cert-path.custom", "<custom-certificate-file-path>")`|
559
+
| Well-Known Certificate | The directory containing well-known certificates|`System.setProperty("azure.cert-path.well-known", "<well-known-certificate-directory>")`|
560
+
| Custom Certificate | The directory containing custom certificates|`System.setProperty("azure.cert-path.custom", "<custom-certificate-directory>")`|
561
561
562
562
Note: These properties support certificate files only (e.g., `.cer`, `.pem`, `.der`, `.crt`). Private keys are not supported.
563
563
564
+
Each keystore loads its own snapshot of these directories when it is constructed and whenever either `KeyStore.load(...)`
565
+
overload is called. Added, replaced, and removed certificate files are reflected after the next load. Calling
566
+
`load(null, null)` or `load((KeyStore.LoadStoreParameter) null)` retains the keystore's configured paths, including paths
567
+
previously supplied through `KeyVaultLoadStoreParameter`; it does not reread system properties.
568
+
569
+
After changing certificate files, reload the keystore and rebuild the trust managers and `SSLContext` that use it.
570
+
Existing trust managers, TLS connections, and TLS sessions are not automatically refreshed. Directory changes are not
571
+
watched, and the Key Vault certificate refresh interval does not reload these filesystem sources.
572
+
564
573
### Key-Less certificates
565
574
You can set the private key as [non-exportable] to ensure the security of the key.
566
575
@@ -915,4 +924,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][microsoft_c
Copy file name to clipboardExpand all lines: sdk/keyvault/azure-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultKeyStore.java
+28-30Lines changed: 28 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,7 @@
24
24
importjava.util.Collections;
25
25
importjava.util.Date;
26
26
importjava.util.Enumeration;
27
-
importjava.util.HashMap;
28
27
importjava.util.List;
29
-
importjava.util.Map;
30
28
importjava.util.logging.Logger;
31
29
32
30
importstaticjava.util.logging.Level.FINE;
@@ -61,16 +59,6 @@ public final class KeyVaultKeyStore extends KeyStoreSpi {
61
59
*/
62
60
privatefinalJreCertificatesjreCertificates;
63
61
64
-
/**
65
-
* Store well Know certificates loaded from specific path.
Copy file name to clipboardExpand all lines: sdk/keyvault/azure-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/implementation/certificates/SpecificPathCertificates.java
0 commit comments