{"id":"95c0297ee365c8aa","repo":"spring-projects/spring-boot","slug":"error-creating-keystore-ex-getmessage","errorCode":null,"errorMessage":"Error creating KeyStore: ${ex.getMessage()}","messagePattern":"Error creating KeyStore: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/ssl/KeyStoreFactory.java","lineNumber":68,"sourceCode":"\t * @param alias the alias to use for KeyStore entries\n\t * @return the {@code KeyStore}\n\t */\n\tstatic KeyStore create(Path certPath, @Nullable Path keyPath, String alias) {\n\t\ttry {\n\t\t\tKeyStore keyStore = getKeyStore();\n\t\t\tString certificateText = Files.readString(certPath);\n\t\t\tList<X509Certificate> certificates = PemCertificateParser.parse(certificateText);\n\t\t\tPrivateKey privateKey = getPrivateKey(keyPath);\n\t\t\ttry {\n\t\t\t\taddCertificates(keyStore, certificates.toArray(X509Certificate[]::new), privateKey, alias);\n\t\t\t}\n\t\t\tcatch (KeyStoreException ex) {\n\t\t\t\tthrow new IllegalStateException(\"Error adding certificates to KeyStore: \" + ex.getMessage(), ex);\n\t\t\t}\n\t\t\treturn keyStore;\n\t\t}\n\t\tcatch (GeneralSecurityException | IOException ex) {\n\t\t\tthrow new IllegalStateException(\"Error creating KeyStore: \" + ex.getMessage(), ex);\n\t\t}\n\t}\n\n\tprivate static KeyStore getKeyStore()\n\t\t\tthrows KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {\n\t\tKeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\tkeyStore.load(null);\n\t\treturn keyStore;\n\t}\n\n\tprivate static @Nullable PrivateKey getPrivateKey(@Nullable Path path) throws IOException {\n\t\tif (path != null && Files.exists(path)) {\n\t\t\tString text = Files.readString(path);\n\t\t\treturn PemPrivateKeyParser.parse(text);\n\t\t}\n\t\treturn null;\n\t}\n","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/spring-projects/spring-boot/blob/5b2dbdbb8be64415eb6552f81ff7c449c8d251e6/buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/ssl/KeyStoreFactory.java#L50-L86","documentation":"Error \"Error creating KeyStore: ${ex.getMessage()}\" thrown in spring-projects/spring-boot.","triggerScenarios":"Thrown at buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/ssl/KeyStoreFactory.java:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"5b2dbdbb8be64415eb6552f81ff7c449c8d251e6","analyzedAt":"2026-08-04T18:53:14.967Z","schemaVersion":2}