Bobcares

How to Fix OpenVPN “verify error depth=0 error=crl has expired” Issue?

by | Aug 2, 2024

The error message “OpenVPN verify error depth=0 error=CRL has expired” means that OpenVPN’s usage of the Certificate Revocation List (CRL) to confirm the validity of client or server certificates has run out. In this article, we’ll see the details of troubleshooting the issue. At Bobcares, with our Server Management Service, we can handle your issues.

Overview
  1. What is meant by “OpenVPN verify error depth=0 error=CRL has expired?”
  2. Fixing “OpenVPN verify error depth=0 error=CRL has expired”
  3. Causes of the Error
  4. Steps for Fixing the Error
  5. Benefits of Fixing the Error
  6. Conclusion

What is meant by “OpenVPN verify error depth=0 error=CRL has expired?”

When the Certificate Revocation List (CRL) that the OpenVPN server is using expires, the error “VERIFY ERROR: depth=0, error=CRL has expired” appears in the VPN client. Clients are unable to connect to the VPN successfully as a result.

openvpn verify error depth=0 error=crl has expired

Fixing “OpenVPN verify error depth=0 error=CRL has expired”

There are several possible reasons and solutions for this problem. The following sections include the causes leading to the issue and the corresponding solution for the issue.

Causes of the Error

1. The CRL expiration date has passed: The OpenVPN server and clients will regard the CRL as expired if it is scheduled to expire in a specific amount of days and that time frame has passed. So, we must create a new CRL with an extended expiration date in order to resolve this.

2. The CRL expiry date is fixed at a previous date: The CRL may appear to be expired in some situations if its expiration date was accidentally changed to a previous date. This may occur if the system clock or date settings have a glitch as well as other problem. So, create a new CRL with the right expiration date to fix this.

3. The CRL expiry date is scheduled at a very far future time: It’s interesting to note that problems might also arise if the CRL expiration date is set to a very distant future (like 55555 days). This is most likely the result of a flaw or restriction in the date handling code. The issue can be fixed by lowering the expiry to a shorter time frame (such as 750 days).

4. Corruption or missing CRL file: The CRL file will be considered expired if it is missing or malformed. It is also shown in the OpenVPN server config (using the crl-verify directive). So, make sure that the CRL file is correctly formed and exists.

Steps for Fixing the Error

In order to fix the “CRL has expired” error in OpenVPN, we can follow these steps to create a new Certificate Revocation List (CRL) and update the server configuration:

1. Generate a New CRL: Initially, we need to create a new CRL with a valid expiration date.

i. Firstly, go to the easy-rsa Directory:

cd /etc/openvpn/easy-rsa

ii. Then, we use the easyrsa script in order to create a new CRL.

easyrsa gen-crl

This command will generate a new crl.pem file containing the updated CRL information.

iii. Now, set a Longer Expiration for the CRL. To set a specific expiration period (e.g., 1 year), edit the vars file.

nano vars

iv. Also, add or modify the following line:

set_var EASYRSA_CRL_DAYS 365

v. Now, save the changes and exit the text editor.

While we can extend the expiration period, it is best to automate the CRL update process rather than relying on a long expiration time.

2. Update the OpenVPN Server Configuration: After generating a new CRL, update the OpenVPN server configuration in order to use it.

i. Open the Server Configuration File:

nano /etc/openvpn/server.conf

ii. Then, update the CRL Path. Find the line that specifies the CRL file and update it to point to the newly generated crl.pem.

crl-verify /etc/openvpn/easy-rsa/crl.pem

iii. Make sure the file path is correct as well as matches the location of the crl.pem.

iv. Save the changes to the server.conf file and exit the text editor.

3. In order to apply the changes, restart the OpenVPN server(We must replace server with our specific OpenVPN server instance name if it differs):

systemctl restart openvpn@server

4. Also, verify System Date and Time: Incorrect system date and time can cause issues with CRL validation.

i. Check the Current Date and Time:

date

ii. Then, update the Date and Time if Needed:

iii. If the date and time are incorrect, use the timedatectl command to set them correctly.

timedatectl set-time "2024-07-04 12:00:00"

Replace the date as well as time with the correct values for the system.

5. Automate CRL Updates: Consider setting up a cron job to automate the CRL update process, ensuring it never expires.

For Example:

0 0 * * * cd /etc/openvpn/easy-rsa/ && ./easyrsa gen-crl && cp /etc/openvpn/easy-rsa/pki/crl.pem /etc/openvpn/crl.pem && systemctl restart openvpn@server

This cron job updates the CRL daily at midnight.

Benefits of Fixing the Error

1. Guarantees that no certificate that has been revoked (because of a hack, its expiration, or any other reason) is able to authenticate as well as establish a VPN connection.

2. One may stop users with revoked certificates from accessing the network without authorization by maintaining an updated CRL.

3. Prevents expired CRLs from causing connection interruptions, thus, guaranteeing customers receive uninterrupted and seamless VPN service.

4. Ensures trouble-free connection for all legitimate users, in turns resulting in reliable and steady network performance.

5. System administrators can save time and effort by reducing the need for manual intervention when automated CRL updates are implemented.

6. Users may have confidence knowing that the company is taking the appropriate precautions to safeguard sensitive data and that their connections are safe.

7. A current CRL aids in preventing harmful network use of compromised certificates.

8. By guaranteeing that both new and current users may connect securely, keeping an updated CRL promotes scalability as businesses expand and their user base rises.

[Want to learn more? Click here to reach us.]

Conclusion

These methods from our Experts should help us fix the OpenVPN error “VERIFY ERROR: depth=0, error=CRL has expired” by making sure all the components are setup correctly. It will also be possible avoid such problems in the future by keeping precise system time and updating the CRL on a regular basis.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF