Creating a Key Store for Testing

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

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.

Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified -keypass value.

Put the server.jks file in the classpath (for instance) and then, in your bootstrap.yml, for the Config Server, create the following settings:

encrypt:
keyStore:
location: classpath:/server.jks
password: letmein
alias: mytestkey
secret: changeme

发布了0 篇原创文章 · 获赞 135 · 访问量 5242

猜你喜欢

转载自blog.csdn.net/blog_programb/article/details/105191456