Skip to content

Commit bb8d074

Browse files
committed
use hardcoded jks type for loading cacerts
it seems with jdk9 KeyStore.getDefaultType() did change fixes #79
1 parent e445599 commit bb8d074

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • src/main/java/org/jruby/ext/openssl/x509store

src/main/java/org/jruby/ext/openssl/x509store/Lookup.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,10 @@ public int loadDefaultJavaCACertsFile(String certsFile) throws IOException, Gene
356356
final FileInputStream fin = new FileInputStream(certsFile);
357357
int count = 0;
358358
try {
359-
KeyStore keystore = SecurityHelper.getKeyStore(KeyStore.getDefaultType());
360-
// we pass a null password, as the cacerts file isn't password protected
359+
// hardcode the keystore type, as we expcet cacerts to be a java
360+
// keystore - especially needed for jdk9
361+
KeyStore keystore = SecurityHelper.getKeyStore("jks");
362+
// we pass a null password, as the cacerts file isn't password protected
361363
keystore.load(fin, null);
362364
PKIXParameters params = new PKIXParameters(keystore);
363365
for ( TrustAnchor trustAnchor : params.getTrustAnchors() ) {

0 commit comments

Comments
 (0)