Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to select alias for https #11430

Open
viniciusxyz opened this issue Dec 11, 2024 · 0 comments
Open

Unable to select alias for https #11430

viniciusxyz opened this issue Dec 11, 2024 · 0 comments

Comments

@viniciusxyz
Copy link
Contributor

viniciusxyz commented Dec 11, 2024

Expected Behavior

When using one of the properties below I hope the correct alias is selected in PKCS12

micronaut.ssl.key.alias=alias2
micronaut.server.ssl.key.alias=alias2

Actual Behaviour

When I have a PKCS12 with several aliases, I cannot select the desired alias with the properties mentioned above

The alias property "micronaut.ssl.key.alias" is set to "alias2", however when validating the http certificate we should see a CN "localhost2":

image

Steps To Reproduce

  1. Download, compile and run the example application below:

https://github.com/viniciusxyz/https-micronaut

This application has a certificate at the root that was created using this commands:

keytool -genkeypair -v -keystore keystore.p12 -storetype PKCS12 -alias alias1 -keyalg RSA -keysize 2048 -validity 3650 -dname "CN=localhost, OU=Spring Boot, O=My Company, L=City, ST=State, C=BR" -storepass password
keytool -genkeypair -v -keystore keystore.p12 -storetype PKCS12 -alias alias2 -keyalg RSA -keysize 2048 -validity 3650 -dname "CN=localhost2, OU=Spring Boot, O=My Company, L=City, ST=State, C=BR" -storepass password
keytool -genkeypair -v -keystore keystore.p12 -storetype PKCS12 -alias alias3 -keyalg RSA -keysize 2048 -validity 3650 -dname "CN=localhost3, OU=Spring Boot, O=My Company, L=City, ST=State, C=BR" -storepass password
  1. Validate the certificate used for https in the browser, I am validating the CN field and as you can see, each alias has a keypair with a different CN field

Environment Information

No response

Example Application

https://github.com/viniciusxyz/https-micronaut

Version

4.7.6

@viniciusxyz viniciusxyz changed the title The documentation does not provide a way to indicate an alias for https Unable to select alias for https Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant