Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023-06-21 18:57, Kaushal Shriyan wrote:
Hi,

I am running node.js application on port 8000 and Apache HTTP server on CentOS Linux release 7.9.2009 (Core)

# node --version
*v16.20.0*
# httpd -v
Server version: *Apache/2.4.57 (IUS)*
Server built:   Apr  7 2023 14:49:47
#

_httpd.conf file configuration_
#cat /etc/httpd/conf.d/nodejsnodejsssl.conf
<VirtualHost *:443>
     SSLEngine On
     SSLProxyEngine On
     ServerName nodejs.mydomain.com <http://nodejs.mydomain.com>
    SSLCertificateFile /etc/letsencrypt/live/nodejs.mydomain.com/cert.pem <http://nodejs.mydomain.com/cert.pem>     SSLCertificateKeyFile /etc/letsencrypt/live/nodejs.mydomain.com/privkey.pem <http://nodejs.mydomain.com/privkey.pem>     SSLCertificateChainFile /etc/letsencrypt/live/nodejs.mydomain.com/chain.pem <http://nodejs.mydomain.com/chain.pem>
     <Location />
         ProxyPass http://localhost:8000/ <http://localhost:8000/>
     </Location>
</VirtualHost>

When I am trying to access the URL https://nodejs.mydomain.com:8000/demo/index.html <https://nodejs.mydomain.com:8000/demo/index.html>, I am encountering the below error on the browser.

This site can’t provide a secure connection
nodejs.mydomain.com <http://nodejs.mydomain.com> sent an invalid response.
ERR_SSL_PROTOCOL_ERROR

Please comment if the above httpd conf file is incorrect or If i am missing anything. Thanks in advance.

Best Regards,

Kaushal


There are inconsistencies in your configuration.
On one hand, you have "SSLProxyEngine On" which would imply that the backend node.js application is running over TLS. On the other hand, you are proxying to HTTP://, not HTTPS://, which is what you would use for plain-text (not TLS) connections.

The options are mutually exclusive. Either you have TLS on node.js, and should proxy to https://localhost:8000 or you do not, and you shouldn't have "SSLProxyEngine On" defined.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux