Jump to content

[Solution to:] Admin Panel License Connection Error (CURL)


Recommended Posts

Problem

 

Fresh Install: (First time trying to get to admin area)

WHMCS has not been able to verify your license for the last few days.

 

Before you can access your WHMCS Admin Area again, the license needs to be validated successfully. Please check & ensure that you don't have a firewall or DNS rule blocking outgoing connections to our website.

 

Troubleshooting i did:

1. nslookup to whmcs website from the server (no problem)

2. CURL installed and registered in php.ini (no problem)

3. Product key hasnt been used before (no problem)

4. Internet is working on the server without any problem

 

Problem is not solved

 

Recreating the problem:

Please make a php file with the following code and open it in your browser, example name it test.php and open it as http://www.yourdomain.com/test.php

 

<?php if (! function_exists ( 'curl_version' )) {
   exit ( "Enable cURL in PHP" );
}

$ch = curl_init ();
$timeout = 0; // 100; // set to zero for no timeout
$myHITurl = "https://www.whmcs.com";
curl_setopt ( $ch, CURLOPT_URL, $myHITurl );
curl_setopt ( $ch, CURLOPT_HEADER, 0 );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );
$file_contents = curl_exec ( $ch );
if (curl_errno ( $ch )) {
   echo curl_error ( $ch );
   curl_close ( $ch );
   exit ();
}
curl_close ( $ch );

// dump output of api if you want during test
echo "$file_contents"; ?>

this file opens the whmcs website using curl on an SSL connection just like WHMCS does to connect to license servers. If the website opens with you, then this solution will not help you. However if you get an error that probably looks something like this

error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none(on linux machine)

location can change on a windows machine running plesk for example C:\Program Files (x86)\Plesk\Additional\PHPSettings\ca-bundle.crt

Then your problem can be fixed. This is simply the admin panel trying to connect to WHMCS over port 443 SSL secured connection using a local CURL certificate but is unable to complete the connection because the CA certificate is outdated

 

Solution

visit the official CURL website https://curl.haxx.se/docs/caextract.html and download the latest CA certificate cacert.pem

replace the certificate mentioned earlier as per the location presented using the php file above

 

Now try openning the php file again, WHMCS website should open in your browser!

If it does, i am glad i helped you out.. Enjoy :)

 

For plesk server administrators:

Plesk as a daily task to check for CURL certificate updates and update it automatically

click here for the article on how to do that.

Summary of the article incase the link gets moved or purged,

%plesk_dir%\\Additional\\PHPSettings\\cacert.pem file is updated by Daily Maintenance script, by %plesk_dir%\\admin\\plib\\DailyMaintainance\\Task\\UpdatePhpCurlCertificates.php task, in particular.

 

Path %plesk_dir%\\Additional\\PHPSettings\\cacert.pem cannot be customized from Plesk settings.

 

By default, curlCertificatesUrl setting is missing from panel.ini . During an upgrade, or by Daily Maintenance task, Plesk exports certificates to this file by command:

 

"%plesk_dir%\\admin\\bin\\certmng" --export-certificates --path "%plesk_dir%\\Additional\\PHPSettings\\cacert.pem"

If certificate does not work, try to download certificate from http://curl.haxx.se/ca/cacert.pem and put it in C:\\Program Files (x86)\\Parallels\\Plesk\\Additional\\PHPSettings directory.

 

Good Luck

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated