Repository navigation
JWT Add Support for .PEM Certificates (Lets Encrypt etc...) - #3223
prosgarz35 wants to merge 4 commits into
Conversation
|
@quantranhong1999 hi there! can you force build? :) i dont know why it dont do it |
I have no idea about the build infra too. cc @Arsnael . Maybe wait a while and see if the CI takes the build. |
well yeah sometimes its instant, sometimes about 1-3 minuts but there pretty long :D |
|
Seems the build started. The CI is managed by the Infra team of the apache foundation. not us. Mind that there can be sometimes issues or lags. It's not dependant on us. Reminding you as well that open source projects are usually managed by people during their free time, so patience is needed :) |
Arsnael
left a comment
There was a problem hiding this comment.
Not sure if it's really necessary but not against either, thanks
Understood, thank you! I completely respect your time and the volunteer nature of the project. No rush at all on my end. I appreciate you triggering the build and taking a look at this! |
i just want in future use ONE certificate for all SMTP/IMAP/POP/JWT/API because... why not? its more comfortable then java keystores |
|
The CI build failure is unrelated to this PR. All JWT tests passed ( |
|
FYI, I just restart the build |
alot of thanks! |
| return Optional.of(new JcaPEMKeyConverter().getPublicKey((SubjectPublicKeyInfo) readPEM)); | ||
| } | ||
| LOGGER.warn("Key is not an instance of SubjectPublicKeyInfo but of {}", readPEM); | ||
| if (readPEM instanceof X509CertificateHolder) { |
There was a problem hiding this comment.
On the principle, yes.
In practice certificate means we likely shall check notBefore/notAfter...
There was a problem hiding this comment.
On the principle, yes.
In practice certificate means we likely shall check
notBefore/notAfter...
i made it check but only WARN not REJECT cuz... you sure dont wanna your server going down when you just forget this certificate...
| if (now.before(certHolder.getNotBefore()) || now.after(certHolder.getNotAfter())) { | ||
| LOGGER.warn("Certificate is not valid at {}. Validity: [{} - {}]", | ||
| now, certHolder.getNotBefore(), certHolder.getNotAfter()); | ||
| } |
There was a problem hiding this comment.
Can we throw by default?
and add a bypass option -Djames.pem.certificates.allow.outdated=false by default ?
There was a problem hiding this comment.
Why do we even need a bypass option? Why should using an outdated certificate ever be an option? Clients hopefully reject it anyway.
There was a problem hiding this comment.
I can say why - example there russian certs which dont counts as safe for all browser and other programmes but under sanctions some companies cant issue lets encryp and other acme certificates - only self sigh or this national certificates... And this option seems needed
There was a problem hiding this comment.
Yes, sometimes certificates are necessary that would not be valid in a normal browser (e.g. for testing).
But the issue there is the certificate chain, not the validity period. If you self-sign, why not just choose a proper validity period?
There was a problem hiding this comment.
In first version realization was same as for imap/pop/smtp - just use certificates without even look at correctly or not. I dont sure it is good or not option. Maybe really better do acme in james but as first steps in refactoring its good dont it?
There was a problem hiding this comment.
I am not generally against adding some sanity check.
However, I think that java properties should be used sparely. As this validity period check can always be fixed (generate new self-signed certificate / get new certificate from our issuer), I do not understand why it deserves an additional property.
And the property is not documented in any way, so how would I know how to configure it?
|
@chibenwa its here! |
yeah i make it :) thanks to you and good morning :) lets make james more friendly for non spec users |
| private final boolean allowOutdated; | ||
|
|
||
| public PublicKeyReader() { | ||
| this(Clock.systemUTC(), Boolean.getBoolean(ALLOW_OUTDATED_PROPERTY)); |
There was a problem hiding this comment.
Please make it more explicit that default value is false
|
Hello @prosgarz35 Would you find time to address the nitpick ? Otherwise I'm happy to help. Best regards, Benoit |
Not much to say i think?