Fixing the ‘gnutls_handshake() failed: handshake failed’ error on a Debian system

Most web server administrators running Debian systems have encountered the error “gnutls_handshake() failed: Handshake failed” when trying to install and configure a web server. As an experienced system administrator, I have found that this error can be resolved simply by running uname to determine the underlying issue.

What is uname?

uname is a Linux command used to determine a variety of system information, such as the processor type, the kernel architecture, and the server’s system name. In this case, we can use uname to help us identify and address the underlying issue causing the gnutls_handshake() error.

How to use uname to fix the error

  1. Run the following command in your terminal: uname -r. This will return the current kernel version.
  2. Check the output of uname -r against your currently installed kernel version. You can do this by running dpkg -l | grep linux-image.
  3. If the version returned by uname -r is different from your currently installed version, your kernel needs to be updated. Run sudo apt-get upgrade linux-image to update your kernel.
  4. If the version returned by uname -r matches your installed version, then your kernel is up to date. The system is likely having issues because of a misconfigured TLS (Transport Layer Security). You can try to resolve the misconfiguration by running sudo systemctl restart apache2,sudo systemctl restart postfix or sudo systemctl restart nginx depending on which web server you’re running.
  5. If that doesn’t fix the error, you’ll need to manually fix the misconfigured TLS. To do this, edit the appropriate configuration file. Default paths to configuration files would be /etc/apache2/apache2.conf, /etc/postfix/ or /etc/nginx/nginx.conf, depending on which web server you’re running.


The error “gnutls_handshake() failed: Handshake failed” can be a challenge to the inexperienced administrator. However, by running the uname command to check the underlying issue and performing the appropriate steps, the error can be easily resolved with minimal disruption to your web server.

I hope this article has been able to shed some light on how to troubleshoot this error and get your web server running smoothly again.

Author: admin

Leave a Reply

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