-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Allow PemContent.of to work with untrimmed content #41540
Comments
I'm not to keen to add a |
We discussed this today and we don't think we should add the property editor, but we do think we can make the |
Thank you, sir. I am so glad to hear that. |
If we refine only |
just a hint, sir.
|
Is the trimming necessary? the The only way to get the original un-trimmed content back is by calling So maybe just adding a converter without the trimming is sufficient? @yingzhuo did i miss something? Is the trimming necessary? |
@mhalbritter Thank you. sir /*
TEST NG
java.lang.IllegalStateException: Missing certificates or unrecognized format
at org.springframework.util.Assert.state(Assert.java:76)
at org.springframework.boot.ssl.pem.PemCertificateParser.parse(PemCertificateParser.java:64)
at org.springframework.boot.ssl.pem.PemContent.getCertificates(PemContent.java:64)
at com.github.yingzhuo.playground.PemContentTestCase.test1(PemContentTestCase.java:22)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
*/
@Test
void test1() {
var pem = """
-----BEGIN CERTIFICATE-----
MIHrMIGeoAMCAQICFF4UkhlALvGwUHfuZBulAZDim5rlMAUGAytlcDAVMRMwEQYD
VQQDDApwbGF5Z3JvdW5kMCAXDTIzMTIzMTE2MDAwMFoYDzIxMjQxMjMxMTU1OTU5
WjAVMRMwEQYDVQQDDApwbGF5Z3JvdW5kMCowBQYDK2VwAyEAl1mgT4NWO98CmI8L
BfKUV7TU9OQUdBDEOqgLAZyPzQkwBQYDK2VwA0EAm+Xj5Zhqk3tcSWEKEnUuSz+6
pry+jfwdMCI7dvDurDucqQAZxLavHUI3BuQNcT4ozdT7Zu0OHgSK1PQYvAFvCQ==
-----END CERTIFICATE-----
""";
var pemContent = PemContent.of(pem);
pemContent.getCertificates().forEach(System.out::println);
} /*
TEST OK
*/
@Test
void test2() {
var pem = """
-----BEGIN CERTIFICATE-----
MIHrMIGeoAMCAQICFF4UkhlALvGwUHfuZBulAZDim5rlMAUGAytlcDAVMRMwEQYD
VQQDDApwbGF5Z3JvdW5kMCAXDTIzMTIzMTE2MDAwMFoYDzIxMjQxMjMxMTU1OTU5
WjAVMRMwEQYDVQQDDApwbGF5Z3JvdW5kMCowBQYDK2VwAyEAl1mgT4NWO98CmI8L
BfKUV7TU9OQUdBDEOqgLAZyPzQkwBQYDK2VwA0EAm+Xj5Zhqk3tcSWEKEnUuSz+6
pry+jfwdMCI7dvDurDucqQAZxLavHUI3BuQNcT4ozdT7Zu0OHgSK1PQYvAFvCQ==
-----END CERTIFICATE-----
""";
var pemContent = PemContent.of(pem);
pemContent.getCertificates().forEach(System.out::println);
} my version: spring-boot 3.3.2 |
I see, thanks for the clarification. The trimming is needed indeed. |
We discussed this today and we're going to try stripping out the unwanted whitespace in private |
Hello.
I am currently using Spring Boot 3.3.1, I noticed the utility
org.springframework.boot.ssl.pem.PemContent
is very useful.how about add a
PropertyEditor
to the package? here is my code:so i can config my bean like this:
@scottfrederick your code of SSL is very cool, thanks.
The text was updated successfully, but these errors were encountered: