Email TLS Version 1.2

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Email TLS Version 1.2

Post by optionstechnology »

Our environment only supports TLS version 1.2

My Nagios server is- NagsioXI 5.8.3 running PHP 5.4.16

I can see from this thread for the nagios log server that its possible to change the TLS version without updating php- https://support.nagios.com/forum/viewto ... 38&t=61368

I have found the equivalent in NagiosXI -
\usr\local\nagiosxi\html\includes\phpmailer\class.smtp.php

So it seems like nagiosXI is already setup to allow for TLS 1.2, I added some simple code to make sure the "if" loop is being executed-

Code: Select all

    public function startTLS()
    {
        if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
            return false;
        }

$myfile = fopen("/tmp/newfile.txt", "w");
fwrite($myfile, "Script is executing\n");

        //Allow the best TLS version(s) we can
        $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;

        //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
        //so add them back in manually if we can
        if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
			
fwrite($myfile, "TLS 1.2 found\n");
			
			
            $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
            $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
        }
		
fwrite($myfile, "closing\n");
fclose($myfile);
but my /tmp/newfile.txt contains-

Script is executing
closing

which suggests that the loop is not executing to include TLS 1.2

Any idea how to fix? do i just need to update php?
User avatar
kfanselow
Posts: 252
Joined: Tue Aug 31, 2021 3:25 pm

Re: Email TLS Version 1.2

Post by kfanselow »

Hi optionstechnology,

You are correct NagiosXI is able to use TLS1.2 however PHP needs to be version 5.6.x or higher for it to work. Please find a link to our knowledge base article on upgrading to PHP 7 append below:

https://support.nagios.com/kb/article/n ... 7-860.html

As always, we encourage you to go through this process with test server first, which is specifically allowed by our licensing agreement.

Nagios License Entitlements
https://support.nagios.com/kb/article.php?id=145
"With every purchase we offer 3 separate activation of XI licenses. One for production, one for testing, and one for high availability. We always recommend upgrading on a test server first before making changes to the production server."
Thanks and Best Regards,
Keith
Locked