Self Cert signed SSL Error when downloading attached documents

After I upgraded to V5.6.2 the ability to view attached documents was removed … and it was suggested we download documents instead of viewing them. When I try to download attached documents my browser says that the download is completed and when I try to view the document it is 0 bytes long.

When I look in the laravel log after I try to download a document this error appear

[2023-08-01 11:24:19] production.ERROR: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:0A000086:SSL routines::certificate verify failed {“userId”:2,“exception”:"[object] (ErrorException(code: 0): file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:0A000086:SSL routines::certificate verify failed at /var/www/invoiceninja/app/Http/Controllers/DocumentController.php:124)

I suspect the change in V5.6.2 that causes this was:

Add auth to document downloads by @turbo124 in #8555

Can anyone give me some ideas on how fix the error above and keep on using self signed certificates.

Regards

GV

Hi,

In the latest version of the app we added back the option to view documents without downloading them.

@david any ideas on the SSL error, I’ve seen this reported from a few users.

Hi Hillel,

I updated to
image

Then I tried to view an attached invoice


and I got this result

And the error still persists, however this time I copied the stacktrace as well maybe this will help ?

[2023-08-06 10:23:42] production.ERROR: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:0A000086:SSL routines::certificate verify failed {“userId”:2,“exception”:"[object] (ErrorException(code: 0): file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:0A000086:SSL routines::certificate verify failed at /var/www/invoiceninja/app/Http/Controllers/DocumentController.php:124)
[stacktrace]
#0 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(270): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#2 /var/www/invoiceninja/app/Http/Controllers/DocumentController.php(124): file_get_contents()
#3 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(145): App\Http\Controllers\DocumentController->App\Http\Controllers\{closure}()
#4 /var/www/invoiceninja/vendor/symfony/http-foundation/StreamedResponse.php(97): Illuminate\Routing\ResponseFactory->Illuminate\Routing\{closure}()
#5 /var/www/invoiceninja/vendor/symfony/http-foundation/Response.php(423): Symfony\Component\HttpFoundation\StreamedResponse->sendContent()
#6 /var/www/invoiceninja/public/index.php(61): Symfony\Component\HttpFoundation\Response->send()
#7 {main}
"}

Regards

George V

Are you able to test it in the React app?

@david do you have any suggestions?

Hi Hillel,

Seems to work in the React app … hmmm … I will have a mutiny on my hands if I switch over to react :crazy_face:… It is my wife’s naturopathic business and I just got her trained up in the webb app … :zipper_mouth_face:

That said it is the first time I even looked at the react up … I must say it is a lot cleaner !!

I’m considering switching… could be painful though …

anyhow it seems to work …

Regards

George V

@david any ideas why this error would be generated by the Flutter app but not the React app?

Hi Hillel,

I do not know if I’m missing something but the react app does not have a Transaction entry field

is this correct?

Regards

George V

@david can you please advise?

Note: there are two questions in this thread:

  • SSL error with documents in the Flutter app but not the React app
  • Locating the transactions option in the React app