Skip to content

Commit

Permalink
Merge pull request #1504 from LittleFox94/bks-instead-of-jks
Browse files Browse the repository at this point in the history
Fallback to BKS when JKS is not available
  • Loading branch information
k8s-ci-robot committed Jan 21, 2021
2 parents fbc53f8 + 7e8ca08 commit 248d384
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion util/src/main/java/io/kubernetes/client/util/SSLUtils.java
Expand Up @@ -179,7 +179,16 @@ public static KeyStore createKeyStore(

PrivateKey privateKey = loadKey(keyInputStream, clientKeyAlgo);

KeyStore keyStore = KeyStore.getInstance("JKS");
KeyStore keyStore;
try {
keyStore = KeyStore.getInstance("JKS");
} catch (KeyStoreException e) {
// Not having an instance of JKS happens on Android, for example.
// Since we rely on BouncyCastle anyway, let's try BKS instead
// (which is BouncyCastle's JKS compatible provider).
keyStore = KeyStore.getInstance("BKS");
}

if (keyStoreFile != null && keyStoreFile.length() > 0) {
keyStore.load(new FileInputStream(keyStoreFile), keyStorePassphrase);
} else {
Expand Down

0 comments on commit 248d384

Please sign in to comment.