简体   繁体   中英

Can't use PHPMailer to sign with S/MIME, getting "Signing Error: "

I'm using phpmailer to try to send signed emails (S/MIME).

I used this excellent tutorial by John Dalesandro to create a Self-Signed S/MIME Certificate and package it in PKCS12 Format.

I then followed the instructions in PHPMailer S/MIME signing to make cert.crt, cert.key & certchain.pem from my PKCS12 package.

When I sign with the code below I get "Signing Error:":

$mail->sign(
  '/mypath/cert.crt', 
  '/mypath/cert.key', 
  'mypassword',
  '/mypath/certchain.pem'
);

The emails are sent normally when I don't try to sign the email.

Since there is no explanation at all in my error code, I don't understand what I'm doing wrong.

So I got a S/MIME certificate in PKCS12 from a external certificate authority. I then made a cert.crt, cert.key & certchain.pem as stated above and now it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM