11/*
2- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -115,12 +115,12 @@ class TestCertificates {
115115 private TestCertificates () {}
116116
117117 public static KeyStore getKeyStore () throws GeneralSecurityException , IOException {
118- KeyStore result = KeyStore .getInstance ("JKS" );
118+ KeyStore result = KeyStore .getInstance (KeyStore . getDefaultType () );
119119 result .load (null , null );
120120 CertificateFactory cf = CertificateFactory .getInstance ("X.509" );
121121 Certificate serverCert = cf .generateCertificate (
122122 new ByteArrayInputStream (
123- TestCertificates . SERVER_CERT .getBytes (StandardCharsets .ISO_8859_1 )));
123+ SERVER_CERT .getBytes (StandardCharsets .ISO_8859_1 )));
124124 Certificate caCert = cf .generateCertificate (
125125 new ByteArrayInputStream (
126126 CA_CERT .getBytes (StandardCharsets .ISO_8859_1 )));
@@ -135,7 +135,7 @@ public static KeyStore getKeyStore() throws GeneralSecurityException, IOExceptio
135135 }
136136
137137 public static KeyStore getTrustStore () throws GeneralSecurityException , IOException {
138- KeyStore result = KeyStore .getInstance ("JKS" );
138+ KeyStore result = KeyStore .getInstance (KeyStore . getDefaultType () );
139139 result .load (null , null );
140140 CertificateFactory cf = CertificateFactory .getInstance ("X.509" );
141141 Certificate rootcaCert = cf .generateCertificate (
0 commit comments