Page 1 of 1

ssl redirection fails after upgrade to XI 2012R2.2

Posted: Thu Jun 06, 2013 12:30 pm
by intelXIadmin
Nagios XI 2012R2
Redhat 6.4 x64

Hello,

I just upgraded NagiosXI to 2012R2. I have redirection working so anytime somebody typed in http://'server'/nagiosxi they would get redirected to https and it worked before the upgrade. Now it doesn't and I can't seem to get it redirecting to https:

Here is a copy of the nagiosxi.conf file:

#NameVirtualHost *:443
<VirtualHost *:80> # Add this line
<Directory "/usr/local/nagiosxi/html">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
# AuthName "Nagios XI"
# AuthType Basic
# AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
# Require valid-user
</Directory> # Add this line
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
<Directory "/usr/local/nagiosxi/html">
AllowOverride All
</Directory>
</VirtualHost>
Alias /nagiosxi "/usr/local/nagiosxi/html"




My /etc/httpd/conf/httpd.conf file has the following at the end:


RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

Re: ssl redirection fails after upgrade to XI 2012R2.2

Posted: Thu Jun 06, 2013 1:12 pm
by abrist
We did have an issue with ssl in the newest release. The solution below may help you:
Open the following file and make the edits suggested:

Code: Select all

vi /usr/local/nagiosxi/html/includes/utilsx.inc.php
Edit line 167:

Code: Select all

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,2);
to:

Code: Select all

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,1);
Changing the 2 to a 1.

Re: ssl redirection fails after upgrade to XI 2012R2.2

Posted: Wed Jul 03, 2013 5:02 pm
by intelXIadmin
Hello,

I know it has been a long time here, but I tried this a few weeks back and it still doesn't work.

Regards,

Randy.

Re: ssl redirection fails after upgrade to XI 2012R2.2

Posted: Mon Jul 08, 2013 10:18 am
by abrist
Was apache updated on your server when the packages were upgraded?
You may want to try the suggestion on apache's site for https redirection with mod_rewrite:
http://httpd.apache.org/docs/current/re ... onicalhost