lsnepomuceno / laravel-a1-pdf-sign

Sign PDF files with valid x509 certificate
https://laravel-a1-pdf-sign.netlify.app/
MIT License
283 stars 54 forks source link

Error outputting keys and certificates #132

Closed yvescleuder closed 9 months ago

yvescleuder commented 9 months ago

Describe the bug Error when trying to read the file, it seems like it is an openSSL error, but I couldn't find the recommendation for the version they are using.

To Reproduce use LSNepomuceno\LaravelA1PdfSign\Sign\ManageCert; $cert = new ManageCert; $cert->setPreservePfx()->fromPfx('/var/www/public/file.pfx', 'my_password');

LSNepomuceno\LaravelA1PdfSign\Exceptions\ProcessRunTimeException with message 'Process runtime error, reason: "Error outputting keys and certificates. 20202682FFFF0000:error:0308010C:digital envelope routines:inner_evp_generic_fetch:unsupported:../crypto/evp/evp_fetch.c:373:Global default library context, Algorithm (RC2-40-CBC : 0), Properties (). "'

Versions involved:

yvescleuder commented 9 months ago

https://stackoverflow.com/a/77126274

Worked for me

lsnepomuceno commented 9 months ago

I researched the subject and I don't consider it an error in the package or OpenSSL.

The problem occurs when the set of keys does not support the latest versions of OpenSSL, requiring a change in the environment where the platform is running.

As it is something specific in your environment, I recommend that you use the same solution mentioned on StackOverflow.

In local tests I saw that automating this configuration becomes complex, since each environment has a different ".cnf" file.

That being said, we will not be applying the fix via this package.

Other references: https://github.com/php/php-src/issues/9890 https://github.com/php/php-src/issues/12369#issuecomment-1778189374 https://github.com/nfephp-org/sped-common/issues/279#issuecomment-1119701682