prosgarz35 commented on code in PR #3223:
URL: https://github.com/apache/james-project/pull/3223#discussion_r4166889988


##########
server/protocols/jwt/src/main/java/org/apache/james/jwt/PublicKeyReader.java:
##########
@@ -46,7 +58,13 @@ private Optional<PublicKey> publicKeyFrom(PEMParser reader) {
                 return Optional.of(new 
JcaPEMKeyConverter().getPublicKey((SubjectPublicKeyInfo) readPEM));
             }
             if (readPEM instanceof X509CertificateHolder) {
-                SubjectPublicKeyInfo keyInfo = ((X509CertificateHolder) 
readPEM).getSubjectPublicKeyInfo();
+                X509CertificateHolder certHolder = (X509CertificateHolder) 
readPEM;
+                Date now = Date.from(clock.instant());
+                if (now.before(certHolder.getNotBefore()) || 
now.after(certHolder.getNotAfter())) {
+                    LOGGER.warn("Certificate is not valid at {}. Validity: [{} 
- {}]",
+                        now, certHolder.getNotBefore(), 
certHolder.getNotAfter());
+                }

Review 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?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to