laravel-snappy: SSL resources not loading
I am trying to load a view which generates charts and bars using google charts library, because the chart library is hosted on google server with an SSL, I get the following error :
(1/1) RuntimeException
The exit status code ‘1’ says something went wrong: stderr: "Loading pages (1/6) [> ] 0% [======> ] 10% QSslSocket: cannot resolve CRYPTO_num_locks QSslSocket: cannot resolve CRYPTO_set_id_callback QSslSocket: cannot resolve CRYPTO_set_locking_callback QSslSocket: cannot resolve sk_free QSslSocket: cannot resolve sk_num QSslSocket: cannot resolve sk_pop_free QSslSocket: cannot resolve sk_value QSslSocket: cannot resolve SSL_library_init QSslSocket: cannot resolve SSL_load_error_strings QSslSocket: cannot resolve SSLv3_client_method QSslSocket: cannot resolve SSLv23_client_method QSslSocket: cannot resolve SSLv3_server_method QSslSocket: cannot resolve SSLv23_server_method QSslSocket: cannot resolve X509_STORE_CTX_get_chain QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf QSslSocket: cannot resolve SSLeay QSslSocket: cannot call unresolved function CRYPTO_num_locks QSslSocket: cannot call unresolved function CRYPTO_set_id_callback QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback QSslSocket: cannot call unresolved function SSL_library_init QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function sk_num [===============> ] 25% [=====================> ] 36% [=========================> ] 43% QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function SSL_library_init Warning: Failed to load https://www.gstatic.com/charts/45.2/loader.js (ignore) [============================================================] 100% Counting pages (2/6) [============================================================] Object 1 of 1 Resolving links (4/6) [============================================================] Object 1 of 1 Loading headers and footers (5/6) Printing pages (6/6) [> ] Preparing [===================> ] Page 1 of 3 [=======================================> ] Page 2 of 3 [============================================================] Page 3 of 3 Done Exit with code 1 due to network error: ContentNotFoundError QSslSocket: cannot call unresolved function CRYPTO_num_locks QSslSocket: cannot call unresolved function CRYPTO_set_id_callback QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback " stdout: “” command: /usr/local/bin/wkhtmltopdf-amd64 --lowquality ‘/tmp/knp_snappy59719aad573823.86128540.html’ ‘/tmp/knp_snappy59719aad573c74.43593591.pdf’.
Just so you know, following is my code which I have tried
//return view('pdf.reports', compact('merged', 'request', 'marketplaces', 'brands', 'title', 'type'));
//$pdf = App::make('snappy.pdf');
return SnappyPdf::loadView('pdf.reports', ['merged' => $merged, 'request' => $request, 'marketplaces' => $marketplaces, 'brands' => $brands, 'title' => $title, 'type' => $title])->inline('page.pdf');
//$pdf = SnappyPdf::loadView('pdf.reports', compact('merged', 'request', 'marketplaces', 'brands', 'title', 'type'));
//return $pdf->download();
and the error is because of SSL is my wild guess, I just tried to load a simple view which also didnt work
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 33 (4 by maintainers)
I found a solution that works. checkout @Kaicastledine’s solution on this thread
Summary
Downgrade libssl
apt install libssl-dev=1.0.2g-1ubuntu4.8
Lock it from future upgrades
apt-mark hold libssl-dev
On Ubuntu 17.10 I used the following package to fix this issue.
apt-get install libssl1.0-dev
Ubuntu 18.04.1:
sudo apt-get install libssl1.0-dev
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3001
@icaroscherma Thanks!
sudo apt install libssl1.0-dev
worked like a charm!Forge recipe to install:
@icaroscherma
Try this: sudo apt install libssl1.0-dev=1.0.2n-1ubuntu5
Well I found a hack for this in Laravel I did like the following and it worked
<img class="w100" editable="" mc:edit="mm-92" label="image" src="data:image/jpeg;base64,{{ \base64_encode(@file_get_contents($booking_detail['hotel_picture'])) }}">
Yeah but I’m not sure that is the best way, as you’re actually downgrading lib ssl, right?
@vnetmx Tried in Ubuntu 18.04 Linux AMI (AWS)
But I tried to just
sudo apt install libssl1.0-dev
and I got it working, but it uninstalled php7.2-dev. =(For Ubuntu 18.04, any idea ? 😃
I got stuck with Ubuntu 22.04, so here’s the a recipe that works for that:
update wkhtmltopdf to version 0.12.6 fixed this error
14.04 = apt install libssl-dev=1.0.1f-1ubuntu2.25 (Tested and worked) 18.04 = apt install libssl-dev=1.0.2n-1ubuntu5 (Not tested) @bluemountainteam
The downgrade libs change, right now it’s 4.10 not 4.8, look here for the current version for you. https://packages.ubuntu.com/xenial/libssl1.0.0
@siddharthghedia no solutions so far, google charts doesn’t work locally and it is their TOS also that you cannot use it locally, and wkhtmltopdf doesn’t handle ssl properly