LibreSign / libresign

✍️ Nextcloud app to sign PDF documents
https://libresign.coop
GNU Affero General Public License v3.0
452 stars 51 forks source link

Error: Certificate expired #1762

Closed Bolli84 closed 2 months ago

Bolli84 commented 1 year ago

Creating a document for signature, for a particular user it is not possible to sign and I get the error: Certificate expired

When a request for the signature is started (either by me, or by someone else), the procedure is working normal. Once a particulart user wants to sign it, the user gets the pp-up "Internal error. contact admin" The other users can sign well.

The following output is in the nextcloud log:

[{"file":"\/var\/www\/vhosts\/SERVER-HOST\/SERVER-HOST\/apps\/libresign\/vendor\/jsignpdf\/jsignpdf-php\/src\/JSignPDF.php","line":29,"function":"sign","class":"Jeidison\JSignPDF\Sign\JSignService","type":"->"},{"file":"\/var\/www\/vhosts\/SERVER-HOST\/SERVER-HOST\/apps\/libresign\/lib\/Handler\/JSignPdfHandler.php","line":105,"function":"sign","class":"Jeidison\JSignPDF\JSignPDF","type":"->"},{"file":"\/var\/www\/vhosts\/SERVER-HOST\/SERVER-HOST\/apps\/libresign\/lib\/Handler\/JSignPdfHandler.php","line":77,"function":"signUsingVisibleElements","class":"OCA\Libresign\Handler\JSignPdfHandler","type":"->"},{"file":"\/var\/www\/vhosts\/SERVER-HOST\/SERVER-HOST\/apps\/libresign\/lib\/Handler\/Pkcs12Handler.php","line":126,"function":"sign","class":"OCA\Libresign\Handler\JSignPdfHandler","type":"->"},{"file":"\/var\/www\/vhosts\/SERVER-HOST\/SERVER-HOST\/apps\/libresign\/lib\/Service\/SignFileService.php","line":618,"function":"sign","class":"OCA\Libresign\Handler\Pkcs12Handler","type":"->"},{"file":"\/var\/www\/vhosts\/SERVER-HOST\/SERVER-HOST\/apps\/libresign\/lib\/Controller\/SignFileController.php","line":207,"function":"sign","class":"OCA\Libresign\Service\SignFileService","type":"->"},{"file":"\/var\/www\/vhosts\/SERVER-HOST\/SERVER-HOST\/apps\/libresign\/lib\/Controller\/SignFileController.php","line":180,"function":"sign","class":"OCA\Libresign\Controller\SignFileController","type":"->"},{"file":"\/var\/www\/vhosts\/SERVER-HOST\/SERVER-HOST\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":230,"function":"signUsingUuid","class":"OCA\Libresign\Controller\SignFileController","type":"->"},{"file":"\/var\/www\/vhosts\/SERVER-HOST\/SERVER-HOST\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":137,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"\/var\/www\/vhosts\/SERVER-HOST\/SERVER-HOST\/lib\/private\/AppFramework\/App.php","line":183,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"\/var\/www\/vhosts\/SERVER-HOST\/SERVER-HOST\/lib\/private\/Route\/Router.php","line":315,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"\/var\/www\/vhosts\/SERVER-HOST\/SERVER-HOST\/lib\/base.php","line":1058,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"\/var\/www\/vhosts\/SERVER-HOST\/SERVER-HOST\/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}]

And in addition:

Error | libresign | Certificate expired.

Other users can sign well.

vitormattos commented 1 year ago

Hi. This occur when the certificate is expired. I recommend to you to request to this user generate again the certificate redefining the going to LibreSign settings. https://github.com/JSignPdf/jsignpdf-php/blob/fa302ee5333a8643cf49c60ce33189aa86961350/src/Sign/JSignService.php#L142-L147

By default, the duration of a certificate generated by LibreSign is very big, sounds that this user is using a PFX file generated externally from LibreSign. Verify this first and if possible, return here with this information.

The action to reset password only will work if the certificate was generated by LibreSign because at the moment of reset password will generate a new certificate.

If is an external certificate, this user will need to generate a new pfx file outside of LibreSign and put the new certificate file inside LibreSign folder.

I will maintain this issue open because is necessary to cover this scenario with an user case.

Thanks by your report.

Bolli84 commented 1 year ago

Thank you. Resetting the password for this user helped!

vitormattos commented 2 months ago

Closing as solved.

PS: If you like this app, don't hesitate to help us to maintain the development sponsoring by GitHub sponsor https://github.com/sponsors/LibreSign or also contacting us to have Enterprise support: https://libresign.coop