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

aAPCertificate parameter in IPhase4PeppolCertificateCheckResultHandler is Nullable #206

Closed
Florianisme opened this issue Jan 4, 2024 · 1 comment
Assignees
Labels
bug Profile Peppol Peppol AS4 related

Comments

@Florianisme
Copy link

Florianisme commented Jan 4, 2024

Hi Philip,

I have encountered a NPE while sending an outbound Peppol message because I relied on the @Nonnull annotation in IPhase4PeppolCertificateCheckResultHandler for the @Nonnull X509Certificate aAPCertificate parameter.

java.lang.NullPointerException: Cannot invoke "java.security.cert.X509Certificate.getSubjectX500Principal()" because "certificate" is null at 
de.i.p.o.OutboundMessageProcessor.lambda$buildCertificateConsumer$3(OutboundMessageProcessor.java:160) at 
com.helger.phase4.peppol.Phase4PeppolSender$AbstractPeppolUserMessageBuilder.finishFields(Phase4PeppolSender.java:801) at 
com.helger.phase4.peppol.Phase4PeppolSender$Builder.finishFields(Phase4PeppolSender.java:1344) at 
com.helger.phase4.sender.AbstractAS4MessageBuilder.sendMessage(AbstractAS4MessageBuilder.java:831) at 
com.helger.phase4.sender.AbstractAS4UserMessageBuilder.sendMessageAndCheckForReceipt(AbstractAS4UserMessageBuilder.java:798) 

Going through the code I can see where this is coming from:

Phase4PeppolSender.java (m_bCheckReceiverAPCertificate is false)
image

From this point onwards the certificate is declared as Nullable:
AS4EndpointDetailProviderPeppol.java
image

@phax phax self-assigned this Jan 4, 2024
@phax phax added Profile Peppol Peppol AS4 related bug labels Jan 4, 2024
phax added a commit that referenced this issue Jan 4, 2024
@phax
Copy link
Owner

phax commented Jan 4, 2024

Thanks, fixed in the upcoming 2.7.0 release.
All other parameters are indeed non-null.

@phax phax closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Profile Peppol Peppol AS4 related
Projects
None yet
Development

No branches or pull requests

2 participants