0

Trying to create an AS2 EDI connection with a signed MDN using the PHP AS2Secure library running on Ubuntu 14.04.

When the app issues this command:

openssl smime -encrypt -in '/tmp/as2file_ipLjR3' -out '/tmp/as2file_j2HDRa' -des3 '/home/server/app/as2secure/partners/sourcingco/SourcingCoAS2.cer' 

It produces this error:

unable to load certificate 140035455448736:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: TRUSTED CERTIFICATE 

Any ideas where I'm getting this wrong?

4
  • As a guess, I'm thinking it's looking for a PEM file and not a CER. serverfault.com/questions/254627/… Commented Jul 29, 2015 at 19:04
  • @Andrew How can I make it look for a CER instead? That is all I am provided by this remote partner and the AS2Secure config uses the value in sec_certificate to encode the messages, which I'm assuming is supposed to reference the remote partner's .cer file. Commented Jul 30, 2015 at 21:59
  • if you have openSSL, why not convert the CER to PEM? The link in my first comment gives you the command to do so. I've only used commercial packages for AS2, not openSSL. Commented Jul 31, 2015 at 2:33
  • @Andrew converting to PEM proved to be the solution I needed. Thanks! Commented Sep 25, 2015 at 22:39

1 Answer 1

1

The PHP AS2Secure library requires a PEM certificate file. While some AS2 implementations rely on .cer self-signed certificate files, this particular library requires PEM.

As it relies on OpenSSL, you can convert .cer / .der via the following command:

 openssl x509 -inform der -in certificate.cer -out certificate.pem 

This should solve the problem of the software looking for the right format.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.