I have had a hard time trying to successfully test the connection to a URL from an application server via the reverse proxy. And despite much googling for solutions, I can't seem to find a proper answer.
The application server runs on CentOS 6, and PHP 5.3. The reverse proxy server runs on RHEL 8. It is configured with TLS 1.2 and TLS 1.3, and the ssl.conf includes all the configurations needed for a reverse proxy server.
This is the reverse proxy configuration file in the reverse proxy server :
<VirtualHost _default_:443>
SSLEngine on
# ServerName localhost
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerExpire off
# ProxyPreserveHost On
ProxyPass /agc https://10.1.1.26/agc acquire=100 retry=0 keepalive=on connectiontimeout=20
ProxyPassReverse /agc https://10.1.1.26/agc
</VirtualHost>
This is the command I use from the app server to test if the connection to the reverse proxy server is successful :
[root@agrotestapp ~]# curl https://10.1.3.90/agc:443 -v https://10.1.1.26/agc
* About to connect() to proxy 10.1.3.90 port 443 (#0)
* Trying 10.1.3.90... connected
* Connected to 10.1.3.90 (10.1.3.90) port 443 (#0)
* Establish HTTP proxy tunnel to 10.1.3.90:443
* Proxy auth using Basic with user 'jadmin'
> CONNECT 10.1.3.90:443 HTTP/1.1
> Host: 10.1.3.90:443
> Proxy-Authorization: Basic amFkbWluOmdyZWF0RGF5cw==
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.44 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Proxy-Connection: Keep-Alive
>
* Proxy CONNECT aborted
* Closing connection #0
curl: (56) Proxy CONNECT aborted
* About to connect() to proxy 10.1.3.90 port 443 (#0)
* Trying 10.1.3.90... connected
* Connected to 10.1.3.90 (10.1.3.90) port 443 (#0)
* Establish HTTP proxy tunnel to 10.1.1.26:443
* Proxy auth using Basic with user 'jadmin'
> CONNECT 10.1.1.26:443 HTTP/1.1
> Host: 10.1.1.26:443
> Proxy-Authorization: Basic amFkbWluOmdyZWF0RGF5cw==
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.44 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Proxy-Connection: Keep-Alive
>
* Proxy CONNECT aborted
* Closing connection #0
curl: (56) Proxy CONNECT aborted
As you can see, it exits with the curl: (56) Proxy CONNECT aborted error.
Some of the solutions I googled mentioned something about ensuring that SSL cert and keys configured and installed. Others mentioned to ensure that the port number used to curl is correct. The latter is correct for me, but I am not sure if the SSL cert and key solution is correct.
Additionally, these were the error in the logs :
[Fri May 24 18:34:53.804143 2024] [core:notice] [pid 31243:tid 140054901700928] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Fri May 24 18:34:53.804953 2024] [suexec:notice] [pid 31243:tid 140054901700928] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri May 24 18:34:53.805936 2024] [ssl:warn] [pid 31243:tid 140054901700928] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Fri May 24 18:34:53.823249 2024] [ssl:warn] [pid 31243:tid 140054901700928] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Fri May 24 18:34:53.823556 2024] [lbmethod_heartbeat:notice] [pid 31243:tid 140054901700928] AH02282: No slotmem from mod_heartmonitor
[Fri May 24 18:34:53.826286 2024] [mpm_event:notice] [pid 31243:tid 140054901700928] AH00489: Apache/2.4.37 (Oracle Linux) OpenSSL/1.1.1k configured -- resuming normal operations
[Fri May 24 18:34:53.826306 2024] [core:notice] [pid 31243:tid 140054901700928] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
However even when I run setenforce 0, and SELinux is permissive, I still get the same error. I consulted my teammates first about the server hostname does not match name in certificate error, but they don't even use that parameter.
Please guide to fix this issue, and let me know if you need any other information to aid with troubleshooting.