Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Security»How To Enable TLS 1.3/1.2 in Apache

    How To Enable TLS 1.3/1.2 in Apache

    By RahulAugust 11, 20222 Mins Read

    All the SSL and TLS versions older than 1.2 are having lots of known vulnerabilities like POODLE (CVE-2014-3566), That’s why the latest browsers have removed support for these vulnerable protocols. We also recommend moving your server to use TLS versions and specifically to TLS 1.2. This tutorial will help you to enable TLS 1.2 and TLS 1.3 in mod_ssl and Apache servers.

    Advertisement
    • Install and Use Let’s Encrypt SSL with Apache

    Prerequisites

    To enable TLS 1.3 you must have Apache version 2.4.38 or higher on your system. Also search for the SSL virtual host configuration file your system.

    Generally Debian based systems have there files under /etc/apache2/sites-enabled directory.

    And the Redhat (RPM) based system have there configuration in /etc/httpd/conf/httpd.conf file or a sperate file under /etc/httpd/conf.d directory.

    Enable TLS 1.2 only in Apache

    First, edit the virtual host section for your domain in the Apache SSL configuration file on your server and add set the SSLProtocol as followings. This will disable all older protocols and your Apache server and enable TLSv1.2 only.

     SSLProtocol -all +TLSv1.2
    

    The minimal Apache virtual host with SSL looks like this:

    <VirtualHost *:443>
        ServerName www.example.com
        DocumentRoot /var/www/html
    
        SSLEngine on
        SSLProtocol -all +TLSv1.2
        SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
    </VirtualHost>
    

    Enable TLS 1.3 & 1.2 Both in Apache

    The Apache version 2.4.38 or higher versions support TLS v1.3. You must upgrade Apache packages before enabling TLS 1.3 in SSL settings.

     SSLProtocol -all +TLSv1.2 +TLSv1.3
    

    The simplest Apache VirtualHost with SSL looks like below

    <VirtualHost *:443>
        ServerName www.example.com
        DocumentRoot /var/www/html
    
        SSLEngine on
        SSLProtocol -all +TLSv1.2 +TLSv1.3
        SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
    </VirtualHost>
    

    After making changes in your configuration file, restart the Apache service to apply new settings.

    Apache mod_ssl SSL TLS TLS 1.2 TLS 1.3
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to block bad bots using .htaccess

    Comparing Apache MPM Worker and Prefork: Which is Right for Your Application

    How to Install Apache (httpd) on RHEL & CentOS Stream 9

    View 17 Comments

    17 Comments

    1. lokesh on May 17, 2021 8:09 am

      Hi RAHUL K,

      i want to enable TLS1.2 or TLS1.3 on centos CentOS Linux release 7.9.2009 (Core)

      i am looking for the command : not aware much on linux..

      thanks

      Lokesh

      Reply
    2. prasad on April 27, 2021 11:40 am

      HI,

      How to enable ssl/tls ciphers protocols on a web server., please suggest me.

      Thanks
      prasad

      Reply
    3. Lakshmi on August 27, 2020 1:16 pm

      Tried to enable TLS 1.2 in /conf/extra/httpd-ssl.conf in Apache 2.4.10 as below combinations.

      SSLProtocol -all +TLSv1.2

      After restarting httpd service, getting error ‘illegal Protocol TLSv1.2’ as below.
      AH00526: Syntax error on line 260 of /opt/NSAx/apache2.4-npservers/conf/extra/httpd-ssl.conf:
      SSLProtocol: Illegal protocol ‘TLSv1.2’

      Then updated SSLProtocol in http-ssl.conf file.
      SSLProtocol -SSLv3 -TLSv1 -TLSv1.1 +TLSv1.2

      After restarting httpd service, getting error ‘illegal Protocol TLSv1.1’ as below.
      AH00526: Syntax error on line 260 of /opt/NSAx/apache2.4-npservers/conf/extra/httpd-ssl.conf:
      SSLProtocol: Illegal protocol ‘TLSv1.1’

      Set this SSLHonorCipherOrder in httpd-ssl.conf file both on / off. still same error.
      SSLHonorCipherOrder off

      Also tried different set of SSLCipersuite from [https://ssl-config.mozilla.org/#server=apache&version=2.4.10&config=intermediate&openssl=1.0.2k-fips&guideline=5.6][1]

      ran command ‘nmap –script ssl-enum-ciphers -p 443 hostname’ in linux and returned SSLv3, TLSv1.0 enabled.

      Hope, mentioned version of OpenSSL, Apache & Linux OS will support TLS 1.2.
      Please help me, why does this configuration cause ‘illegal protocol’ error and How can I enable TLS 1.2 only with this setup?

      Really Appreciate, if any help.

      Reply
    4. leonard on August 9, 2020 2:20 pm

      Sorry here is the error I got, note that I’m using Windows server 2012

      E:\Programs\ApacheEV02_SSL\bin>httpd -t
      Warning: DocumentRoot [E:/home/www-data] does not exist
      Syntax error on line 29 of E:/Programs/ApacheEV02_SSL/conf/extra/httpd-ssl.conf:
      SSLProtocol: Illegal protocol ‘TLSv1.2’

      Reply
    5. leonard on August 9, 2020 2:15 pm

      Hi,

      I’m trying to install Apache 2.2.25, using TLS 1.2 but I got an error below. I added this configuration on httpd-ssl.conf

      SSLProtocol -all +TLSv1.2 +TLSv1.3

      Reply
    6. Kyle on July 8, 2020 3:13 pm

      Will the handshake work if the SSL Protocol line be set to just:
      SSLProtocol -all +TLSv1.3

      I can’t get it to work like that.
      I can get it to work if it is set like this: (SSLProtocol -all +TLSv1.2 +TLSv1.3)

      Reply
    7. Anu on May 13, 2020 6:27 am

      how to enable tls 1.3 on centos 7 Apache/2.4.6

      Reply
      • Rahul on May 13, 2020 11:19 am

        Apache 2.4.6 doesn’t support TLS 1.3.

        Reply
    8. noName on April 26, 2020 7:04 pm

      “First, edit the VirtualHost section for your domain in the Apache SSL configuration file”

      and where is that file?

      “first get inside the car” but I won’t tell you where is the key

      Reply
      • Rahul on April 27, 2020 6:41 am

        Thanks unknown reader, Added some tips in tutorial to find SSL virtual host file.

        Reply
      • Anon on November 27, 2020 10:58 am

        If you can’t find the key, then maybe you shouldn’t be driving

        Reply
    9. Mohammad on January 16, 2020 12:37 pm

      1.1 version

      Reply
    10. Anil on July 6, 2018 11:28 am

      does java 1.8 support TLS1.2?? I have a tomcat 8.5 server with jdk8u144, I just wanted to check TLS1.2 is enabled or not, Can you please help me out…

      Reply
    11. Musfr on June 26, 2018 2:07 pm

      hi,

      What should be the cipersuite corresponding to TLS1.2. I allowed only TLS 1.2 as u said, but am getting ssh handshaking exception on SOAPUI saying server still supports TLSv1 which is not enabled in soapui app. Please help

      Reply
    12. David on June 19, 2018 10:27 am

      set a ssl certificate in my website but in old browsers site dose not show and show error ( your connection is not private ).my website is https://www10020.travel but my friend websites (https://ghasedak24.com) show without error. please help me

      Reply
    13. pratap on April 25, 2018 10:18 am

      Apache version requirement for TLS 1.2

      Reply
      • Rahul K. on April 25, 2018 11:51 am

        To use TLS 1.2 you must have Apache 2.2.23 or higher and OpenSSL 1.0.1 or higher

        Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to List Manually Installed Packages in Ubuntu & Debian
    • 10 Bash Tricks Every Developer Should Know
    • How to Validate Email Address in JavaScript
    • Firewalld: Common Firewall Rules and Commands
    • 12 Apk Commands in Alpine Linux Package Management
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.