-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Pem SslBundle - allow property source for keystore and truststore #40398
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
Comments
@zbacjxx It is currently possible to provide certificates as PEM content when configuring SSL bundles. An example of this is shown in the documentation: spring:
ssl:
bundle:
pem:
mybundle:
truststore:
certificate: |
-----BEGIN CERTIFICATE-----
MIID1zCCAr+gAwIBAgIUNM5QQv8IzVQsgSmmdPQNaqyzWs4wDQYJKoZIhvcNAQEL
BQAwezELMAkGA1UEBhMCWFgxEjAQBgNVBAgMCVN0YXRlTmFtZTERMA8GA1UEBwwI
...
V0IJjcmYjEZbTvpjFKznvaFiOUv+8L7jHQ1/Yf+9c3C8gSjdUfv88m17pqYXd+Ds
HEmfmNNjht130UyjNCITmLVXyy5p35vWmdf95U3uEbJSnNVtXH8qRmN9oK9mUpDb
ngX6JBJI7fw7tXoqWSLHNiBODM88fUlQSho8
-----END CERTIFICATE----- If you have tried this and it is not working for you, please provide more details on your configuration so we can take a closer look. |
Hi Scott, SslBundle is an amazing addition to the spring framework, thanks for the quick responseI have tried the above however I get an error. I am using spring boot 3.2.2 and application-{env}.properties not a yaml file The following properties work
however when I switch out the keystore.certificate with the following
I get the following exception (message only):
Note: I have also remove the line endings so the cert is on a single line and I get a slightly different error (message only):
|
@zbacjxx you don't appear to have formatted the multi-line string correctly. You can either use YAML and minimise the necessary formatting or you can include newlines in the value. This is shown in the documentation that Scott linked to above.
|
ah - sorry I am an absolute idiot in that case as that works! Mnay thanks for your time on this - I should have done a better job reading the docs (my quick googles didnt point me to the latest) I did notice a ticket authored by your good self here (which led me to raise this ticket) on SslBundle usage for kafka - I have gone through the above docs and the kafka docs and I cant see any documentation on how to use the SslBundle on the KafkaTemplate as per the RestTemplate - Is this available? |
You can use If you have any further questions, please follow up on Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. |
fair point and thanks again |
Uh oh!
There was an error while loading. Please reload this page.
Current implementation allows us to specify a location.
Ideally we could also specify a property that contains the pem file e.g ${my.app.trust.cert}
This would allow us to inject certificates from external stores at deploy time in an externalised property file rather than bundling files into the app deployment e.g via /resources
The text was updated successfully, but these errors were encountered: