Unable to apply white label license since 5.10.8

When applying the v5 white label license. I see this error: “Something went wrong”
I see that an 500 error occurred in the url: https://invoiceninjadomain.com/api/v1/claim_license?license_key=v5_xxxxxxxx-xxxx- xxxx-xxxx-xxxxxxxxxxx (fake url)

The error occurres in “bundle.js” on line 359:

{
“message”: “Request failed with status code 500”,
“name”: “AxiosError”,
“config”: {
“transitional”: {
“silentJSONParsing”: true,
“forcedJSONParsing”: true,
“clarifyTimeoutError”: false
},
“transformRequest”: [
null
],
“transformResponse”: [
null
],
“timeout”: 0,
“xsrfCookieName”: “XSRF-TOKEN”,
“xsrfHeaderName”: “X-XSRF-TOKEN”,
“maxContentLength”: -1,
“maxBodyLength”: -1,
“env”: {
“FormData”: null
},
“headers”: {
“Accept”: “application/json, text/plain, /”,
“X-Api-Token”: “tYCPDIfLgkBfZlKD7D907FO5Iz6nNgXA3UsqiBdsu8vzd5A2piYLaKXLaMflqEIm”,
“X-Requested-With”: “XMLHttpRequest”,
“X-React”: “true”,
“X-XSRF-TOKEN”: “eyJpdiI6InVyWmtTYnJpNmtrcHE0aEJkVkxEYnc9PSIsInZhbHVlIjoiK3NrN3VyaVdqOEZxR05iL0dydGk3dUVxeldpeG5mVFVDeGQzZHZDejRnd1FpUkJSa2FhV05tZTBnWXlEUjBiL3VlUjJWZjFDeGlUUS9xalZiclNrcVdjRFAxc2xHcVFOWENaOXpXTDliZlU0RE5DUkt3SURYcVExUUZndXBrM1AiLCJtYWMiOiIwMmM3NDFhMmZkNjczNjdiM2E1YjZmZGJmZTkxMjc0ZGVjM2EzMDc5OWYzNWUwMGEzZTc1YmRhNjk5NDA0NzhhIiwidGFnIjoiIn0=”
},
“method”: “post”,
“url”: “https://invoiceninjadomain.com/api/v1/claim_license?license_key=v5_xxxxxxxx-xxxx- xxxx-xxxx-xxxxxxxxxxx”
},
“code”: “ERR_BAD_RESPONSE”,
“status”: 500
}

I see no further errors and everything seems to work fine. I only can not apply the white label license (wich i bought twice now, because i thought that the code was invalid).

My setup has got a good health check on PHP 8.2.20 with:

System
Email: sendmail
queue: sync
PDF: Invoice Ninja Hosted PDF Generator
Database Connection
passed
PHP
web: 8.2.20
cli: PHP 7.3.33 (cli) (built: Jun 26 2024 09:25:34) ( NTS )
Memory: 128M
API: 5.10.8
snappdf_not_enabled
use_snappdf

As a start, you will need to upgrade to PHP 8.2, that is now the minimum required for InvoiceNinja. It seems that you might still have both PHP 7 and 8.2 installed. It is usually recommended to remove previous versions to prevent issues. You will likely need to review your configs to see which one is being pointed to in your .env and cron and either nginx or apache2. You should also increase your PHP memory limit, at minimum to 512M. However, the ideal is 1024M.

Is the error you shared above from your laravel.log? If not, do you have any errors there?

1 Like

Thanx for the Laravel.log heads-up. Here i found the real error:
[2024-07-14 20:27:52] production.ERROR: Invalid crypto_method request option: TLS 1.2 not supported by your version of cURL {“userId”:1,“exception”:"[object] (InvalidArgumentException(code: 0): Invalid crypto_method request option: TLS 1.2 not supported by your version of cURL at /home/user/domains/domain.nl/public_html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:470)

So i need to fix this issue with Curl first.

The version of Curl (checkt through CLI) is: curl 7.29.0.
OS: Centos 7 (i know it is old)

Thanx.

I can’t get Curl updated higher then 7.29.0 because of the old CentOS.
Where does the API use Curl and can i add a max tls version there?
Is curl used for more features in Invoice Ninja?

It looks like guzzlehttp can work with curl 7.29.0 but the api calls the url wit tls 1.2 a assume?

Have you tried building curl from source?

Maybe this will help?

It says 2019, but was updated in 2022.

} elseif (\STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options[‘crypto_method’]) {
//if (!defined(‘CURL_SSLVERSION_TLSv1_2’)) {
// throw new \InvalidArgumentException(‘Invalid crypto_method request option: TLS 1.2 not supported by your version of cURL’);
//}
$conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1;

I commented the error throw and changed “\CURL_SSLVERSION_TLSv1_2” into: “\CURL_SSLVERSION_TLSv1” in the code of public_html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php around line 470.

So the script is adding the option for use of CURL_SSLVERSION_TLSv1 instead of TLSv1.2.

The variable of this setting is in: public_html/vendor/laravel/framework/src/Illuminate/Http/Client/Pendingrequest.php (line 234: STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT). But when changing this one to 1_0 the script in CurlFactory.php tries to set the CURL_SSLVERSION_TLSv1_0 instead of TLSv1 (without the _0).
Corresponding error in laravel.log:

production.ERROR: Undefined constant “CURL_SSLVERSION_TLSv1_0”

So there was an exception for me because the default is TLS1.2 now and when changing the variable i ran into the above error.

For now it is fixed. I know how to use a work-around now.