{"record":{"id":"9c6f210b816db5d2","repo":"quarkusio/quarkus","slug":"unable-to-create-key-store-of-type-type-with","errorCode":null,"errorMessage":"Unable to create key store of type '${type}' with provider '${provider}'","messagePattern":"Unable to create key store of type '(.+?)' with provider '(.+?)'","errorType":"exception","errorClass":"java.lang.IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/tls-registry/runtime/src/main/java/io/quarkus/tls/runtime/keystores/OtherKeyStores.java","lineNumber":134,"sourceCode":"            }\n        } catch (UncheckedIOException e) {\n            throw new IllegalStateException(\"Invalid trust store configuration for certificate '\" + name\n                    + \"' - cannot read the trust store file '\" + config.path().get() + \"'\", e);\n        } catch (IllegalStateException | IllegalArgumentException e) {\n            throw e;\n        } catch (Exception e) {\n            throw new IllegalStateException(\"Invalid trust store configuration for certificate '\" + name + \"'\", e);\n        }\n    }\n\n    private static KeyStore getInstance(String type, Optional<String> provider) {\n        try {\n            if (provider.isPresent()) {\n                return KeyStore.getInstance(type, provider.get());\n            }\n            return KeyStore.getInstance(type);\n        } catch (KeyStoreException | NoSuchProviderException e) {\n            throw new IllegalStateException(\"Unable to create key store of type '\" + type + \"'\"\n                    + (provider.isPresent() ? \" with provider '\" + provider.get() + \"'\" : \"\"), e);\n        }\n    }\n\n    private static void verifyKeyStoreAlias(OtherKeyStoreConfig config, String name, KeyStore ks,\n            String aliasPassword) {\n        if (config.alias().isPresent()) {\n            String alias = config.alias().get();\n            try {\n                if (ks.getCertificate(alias) == null) {\n                    throw new IllegalStateException(\n                            \"Alias '\" + alias + \"' not found in key store (certificate not found) '\" + name + \"'\");\n                }\n            } catch (KeyStoreException e) {\n                throw new IllegalStateException(\"Unable to verify alias '\" + alias + \"' in key store '\" + name + \"'\", e);\n            }\n\n            char[] ap = aliasPassword != null ? aliasPassword.toCharArray() : null;","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/tls-registry/runtime/src/main/java/io/quarkus/tls/runtime/keystores/OtherKeyStores.java#L116-L152","documentation":"Thrown by OtherKeyStores.getInstance (used by the ks loader) when KeyStore.getInstance(type, provider) fails for a non-default store type/provider — i.e. the JVM/security providers cannot construct a KeyStore of the requested type, typically an unknown or unsupported type string or an unavailable provider name. The wrapper names both the requested type and provider so the misconfiguration is identifiable.","triggerScenarios":"getInstance(type, provider) called with a type string no installed provider supports, or a provider name not registered in the JDK.","commonSituations":"Typo like 'pkcs11' vs 'PKCS11'; referencing BouncyCastle provider not registered; custom type on a restricted JVM (native image).","solutions":["Correct the quarkus.tls.key-store.other.type value (e.g. PKCS12, JKS)","If provider set, register it first (Security.addProvider) or drop quarkus.tls.key-store.other.provider","Use a type supported in native image (PKCS12/JKS)"],"exampleFix":"# before\nquarkus.tls.key-store.other.type=pkcs_12\nquarkus.tls.key-store.other.provider=BC\n# after\nquarkus.tls.key-store.other.type=PKCS12\n","handlingStrategy":"validation","validationCode":"try { java.security.KeyStore.getInstance(type); } catch (KeyStoreException e) {\n    throw new IllegalArgumentException(\"Unsupported keystore type: \" + type);\n}\n","typeGuard":null,"tryCatchPattern":"try { init(); } catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Unable to create key store\")) { log.error(\"Check type/provider availability in this JVM\"); }\n    throw e;\n}","preventionTips":["Only use PKCS12/JKS in native image","Register extra providers (e.g. BouncyCastle) explicitly before use","Avoid setting provider unless required"],"tags":["tls","keystore","provider","jvm"],"backgroundTag":"unsupported-keystore-type","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}