Closed evanswappf closed 3 weeks ago
You cannot POST a StandardBusinessDocument document directly to your AS4 endpoint using Postman. The AS4 is a SOAP based protocol on top of HTTP and you need PEPPOL compliant AS4 software to send this the correct way.
Oxalis distribution comes with a simple client called oxalis-standalone you can use : https://github.com/OxalisCommunity/oxalis/blob/master/oxalis-dist/README.md
But to do this the right way you would either need real PEPPOL certificates or some self-signed variants.
Hi @teedjay thanks for the reply I also tested to send using oxalis standalone command line
java -classpath "oxalis-distribution-6.7.0-distro/api/*;oxalis-as4-6.7.0-dist/*;oxalis-distribution-6.7.0-distro/bin/*" eu.sendregning.oxalis.Main -f .\sample.xml --cert .\Peppol_AccessPoint_CA.cer --protocol peppol-transport-as4-v2_0 -u https://peppol-ap-testbed.appfuxion.com/as4
but now its showing this error
2024-09-24 09:55:24,028 WARN [network.oxalis.outbound.transmission.TransmissionRequestBuilder] Endpoint was set by caller not retrieved from SMP, make sure this is intended behaviour.
2024-09-24 09:55:24,043 ERROR [eu.sendregning.oxalis.Main] Execution failed: network.oxalis.api.lang.OxalisTransmissionException: Unable to verify certificate of receiving access point.
java.util.concurrent.ExecutionException: network.oxalis.api.lang.OxalisTransmissionException: Unable to verify certificate of receiving access point.
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at eu.sendregning.oxalis.Main.main(Main.java:228)
Caused by: network.oxalis.api.lang.OxalisTransmissionException: Unable to verify certificate of receiving access point.
at network.oxalis.outbound.transmission.DefaultTransmitter.perform(DefaultTransmitter.java:162)
at network.oxalis.outbound.transmission.DefaultTransmitter.transmit(DefaultTransmitter.java:93)
at eu.sendregning.oxalis.TransmissionTask.performTransmission(TransmissionTask.java:166)
at eu.sendregning.oxalis.TransmissionTask.call(TransmissionTask.java:94)
at eu.sendregning.oxalis.TransmissionTask.call(TransmissionTask.java:48)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: network.oxalis.vefa.peppol.security.lang.PeppolSecurityException: Validation of subject principal(CN) failed.
at network.oxalis.vefa.peppol.security.util.DifiCertificateValidator.validate(DifiCertificateValidator.java:64)
at network.oxalis.commons.mode.OxalisCertificateValidator.perform(OxalisCertificateValidator.java:48)
at network.oxalis.commons.mode.OxalisCertificateValidator.validate(OxalisCertificateValidator.java:38)
at network.oxalis.outbound.transmission.DefaultTransmitter.perform(DefaultTransmitter.java:127)
... 10 common frames omitted
Caused by: network.oxalis.commons.certvalidator.api.FailedValidationException: Validation of subject principal(CN) failed.
at network.oxalis.commons.certvalidator.rule.PrincipalNameRule.validate(PrincipalNameRule.java:68)
at network.oxalis.commons.certvalidator.structure.AndJunction.validate(AndJunction.java:29)
at network.oxalis.commons.certvalidator.structure.AbstractJunction.validate(AbstractJunction.java:36)
at network.oxalis.commons.certvalidator.util.CachedValidatorRule.load(CachedValidatorRule.java:43)
at network.oxalis.commons.certvalidator.util.CachedValidatorRule.load(CachedValidatorRule.java:13)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3570)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2312)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2189)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2079)
at com.google.common.cache.LocalCache.get(LocalCache.java:4011)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4034)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5010)
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5017)
at network.oxalis.commons.certvalidator.util.CachedValidatorRule.validate(CachedValidatorRule.java:30)
at network.oxalis.commons.certvalidator.util.CachedValidatorRule.validate(CachedValidatorRule.java:35)
at network.oxalis.commons.certvalidator.ValidatorGroup.validate(ValidatorGroup.java:79)
at network.oxalis.commons.certvalidator.ValidatorGroup.validate(ValidatorGroup.java:70)
at network.oxalis.vefa.peppol.security.util.DifiCertificateValidator.validate(DifiCertificateValidator.java:62)
... 13 common frames omitted
Total time spent: 0s
Attempted to send 0 files
Failed transmissions: 1
may I know which certificate I need to use for this? because I am only provided with a .p12 file. Thanks. Best regards.
FYI from the postman got 200 response
The Postman output shows POST to your own endpoint, so unable to comment further on that.
The certificate you should be using is the one you got from OpenPEPPOL when enrolling (you should get accesspoint certificates for both TEST and PROD when you enroll).
And you should be able to use the p12 files directly, if you have a recent Java version.
Hi @teedjay I tested sending using the access point cert Peppol_Test_AccessPoint_CA.cer here and receive this error
2024-09-25 10:00:03,548 ERROR [eu.sendregning.oxalis.Main] Execution failed: network.oxalis.api.lang.OxalisTransmissionException: Unable to verify certificate of receiving access point.
java.util.concurrent.ExecutionException: network.oxalis.api.lang.OxalisTransmissionException: Unable to verify certificate of receiving access point.
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at eu.sendregning.oxalis.Main.main(Main.java:228)
Caused by: network.oxalis.api.lang.OxalisTransmissionException: Unable to verify certificate of receiving access point.
at network.oxalis.outbound.transmission.DefaultTransmitter.perform(DefaultTransmitter.java:162)
at network.oxalis.outbound.transmission.DefaultTransmitter.transmit(DefaultTransmitter.java:93)
at eu.sendregning.oxalis.TransmissionTask.performTransmission(TransmissionTask.java:166)
at eu.sendregning.oxalis.TransmissionTask.call(TransmissionTask.java:94)
at eu.sendregning.oxalis.TransmissionTask.call(TransmissionTask.java:48)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: network.oxalis.vefa.peppol.security.lang.PeppolSecurityException: Validation of subject principal(CN) failed.
at network.oxalis.vefa.peppol.security.util.DifiCertificateValidator.validate(DifiCertificateValidator.java:64)
at network.oxalis.commons.mode.OxalisCertificateValidator.perform(OxalisCertificateValidator.java:48)
at network.oxalis.commons.mode.OxalisCertificateValidator.validate(OxalisCertificateValidator.java:38)
at network.oxalis.outbound.transmission.DefaultTransmitter.perform(DefaultTransmitter.java:127)
... 10 common frames omitted
Caused by: network.oxalis.commons.certvalidator.api.FailedValidationException: Validation of subject principal(CN) failed.
at network.oxalis.commons.certvalidator.rule.PrincipalNameRule.validate(PrincipalNameRule.java:68)
at network.oxalis.commons.certvalidator.structure.AndJunction.validate(AndJunction.java:29)
at network.oxalis.commons.certvalidator.structure.AbstractJunction.validate(AbstractJunction.java:36)
at network.oxalis.commons.certvalidator.util.CachedValidatorRule.load(CachedValidatorRule.java:43)
at network.oxalis.commons.certvalidator.util.CachedValidatorRule.load(CachedValidatorRule.java:13)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3570)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2312)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2189)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2079)
at com.google.common.cache.LocalCache.get(LocalCache.java:4011)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4034)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5010)
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5017)
at network.oxalis.commons.certvalidator.util.CachedValidatorRule.validate(CachedValidatorRule.java:30)
at network.oxalis.commons.certvalidator.util.CachedValidatorRule.validate(CachedValidatorRule.java:35)
at network.oxalis.commons.certvalidator.ValidatorGroup.validate(ValidatorGroup.java:79)
at network.oxalis.commons.certvalidator.ValidatorGroup.validate(ValidatorGroup.java:70)
at network.oxalis.vefa.peppol.security.util.DifiCertificateValidator.validate(DifiCertificateValidator.java:62)
... 13 common frames omitted
Total time spent: 0s
Attempted to send 0 files
Failed transmissions: 1
The Postman output shows POST to your own endpoint, so unable to comment further on that.
The certificate you should be using is the one you got from OpenPEPPOL when enrolling (you should get accesspoint certificates for both TEST and PROD when you enroll).
And you should be able to use the p12 files directly, if you have a recent Java version.
Hi @teedjay may I know how to use the p12 to send message in this case? Because peppol only provide us with the p12 file
See combined response in : https://github.com/OxalisCommunity/Oxalis-AS4/issues/261 . This ticket will be closed
Hi I'm hitting this issue while sending message to oxalis-as4 access point. can anyone helping on this? I attached my message xml below. Thanks Best regards.