Tuesday 30 May 2017

Node and Certbot - Error during SSL Handshake with remote server

I'm trying to set up a reverse proxy using Apache 2.2.22 on Ubuntu 12.04 to a local Node server at port 8443 (with node http-proxy).

My Apache proxy.conf looks like this:

SSLProxyEngine on
SSLProxyCheckPeerCN off

ProxyPass /api https://localhost:8443/
ProxyPassReverse /api https://localhost:8443/

<Location /api>
    Order allow,deny
    Allow from all
</Location>

I've used Certbot/Letsencrypt to get a cert for my domain, my.domain.com which I also use for my Node server configuration.

let optsHttps = {
  target: {
    host: 'ext.server.com',
    port: 443,
    https: true
  },
  ssl: {
    key: fs.readFileSync(certDir + 'privkey.pem'),
    cert: fs.readFileSync(certDir + 'fullchain.pem')
  },
  secure: true
};

But I get an error when trying to access the site https://my.domain.com/api

Proxy Error

The proxy server could not handle the request GET /api. Reason: Error during SSL Handshake with remote server

Apache/2.2.22 (Ubuntu) Server at my.domain.com Port 443

I can't really see any activity from the Node server so I guess it's more something to do with Apache being the problem...

If I try to access the site https://my.domain.com it works as expected and serves the site without any problems.

Where have I gone wrong?

Thanks!



via mottosson

No comments:

Post a Comment