From c171a99f9b3af4467ab2690443a1092a7efefebc Mon Sep 17 00:00:00 2001 From: Kosta Stojanovski <115792978+kstojanovski-novatec@users.noreply.github.com> Date: Thu, 15 May 2025 09:38:10 +0200 Subject: [PATCH 1/2] - The format of the generated jks file is PKCS12 by checking it with 'keytool -list -v -keystore server.jks' and the application fails to start. Adding a parameter for creation of keys in JKS format solved the problem. - Using bootstrap.yml does not have any impact on the application. Using application.properties gave the expected effect. Changing the description from bootstrap.yml with application.properties. --- .../pages/server/creating-a-key-store-for-testing.adoc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/modules/ROOT/pages/server/creating-a-key-store-for-testing.adoc b/docs/modules/ROOT/pages/server/creating-a-key-store-for-testing.adoc index 975f6ab3ca..3f84dcb779 100644 --- a/docs/modules/ROOT/pages/server/creating-a-key-store-for-testing.adoc +++ b/docs/modules/ROOT/pages/server/creating-a-key-store-for-testing.adoc @@ -6,7 +6,7 @@ To create a keystore for testing, you can use a command resembling the following ---- $ keytool -genkeypair -alias mytestkey -keyalg RSA \ -dname "CN=Web Server,OU=Unit,O=Organization,L=City,S=State,C=US" \ - -keypass changeme -keystore server.jks -storepass letmein + -keypass changeme -keystore server.jks -storepass letmein -storetype JKS ---- NOTE: When using JDK 11 or above you may get the following warning when using the command above. In this case @@ -16,7 +16,7 @@ Warning: Different store and key passwords not supported for PKCS12 KeyStores. ---- Put the `server.jks` file in the classpath (for instance) and then, in -your `bootstrap.yml`, for the Config Server, create the following settings: +your `application.properties`, for the Config Server, create the following settings: [source,yaml] ---- @@ -27,4 +27,6 @@ encrypt: alias: mytestkey secret: changeme ---- - +---- +Warning: In the erlier versions `bootstrap.yml` was used instead of application.properties (or application.yml or application.yaml) +---- From 5b338a9f97bda2ff2d3fec2642b06f0a7b2c934f Mon Sep 17 00:00:00 2001 From: Kosta Stojanovski <115792978+kstojanovski-novatec@users.noreply.github.com> Date: Fri, 16 May 2025 10:33:18 +0200 Subject: [PATCH 2/2] Update creating-a-key-store-for-testing.adoc Signed-off-by: Kosta Stojanovski <115792978+kstojanovski-novatec@users.noreply.github.com> --- .../server/creating-a-key-store-for-testing.adoc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/modules/ROOT/pages/server/creating-a-key-store-for-testing.adoc b/docs/modules/ROOT/pages/server/creating-a-key-store-for-testing.adoc index 3f84dcb779..3a43d494aa 100644 --- a/docs/modules/ROOT/pages/server/creating-a-key-store-for-testing.adoc +++ b/docs/modules/ROOT/pages/server/creating-a-key-store-for-testing.adoc @@ -9,14 +9,13 @@ $ keytool -genkeypair -alias mytestkey -keyalg RSA \ -keypass changeme -keystore server.jks -storepass letmein -storetype JKS ---- -NOTE: When using JDK 11 or above you may get the following warning when using the command above. In this case -you probably want to make sure the `keypass` and `storepass` values match. +NOTE: When using JDK 11 or above, you may get the following warning when using the command above. In this case +you probably want to ensure the `keypass` and `storepass` values match. ---- -Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified -keypass value. +WARNING: Different store and key passwords are not supported for PKCS12 KeyStores. Ignoring user-specified -keypass value. ---- -Put the `server.jks` file in the classpath (for instance) and then, in -your `application.properties`, for the Config Server, create the following settings: +Put the `server.jks` file in the classpath (for instance) and then, in your `application.properties` create the following settings: [source,yaml] ---- @@ -27,6 +26,7 @@ encrypt: alias: mytestkey secret: changeme ---- ----- -Warning: In the erlier versions `bootstrap.yml` was used instead of application.properties (or application.yml or application.yaml) ----- + +TIP: If you want to use `bootstrap.yml` instead of `application.properties` +you must first enable it through `spring.cloud.bootstrap.enabled=true` or include +the dependency (maven, gradle) as `groupId:org.springframework.cloud` and `artifactId:spring-cloud-starter-bootstrap`.