SSL on Google Compute Engine with nodejs hosts

Summary:

I am trying to configure the Node.js server in the Google Compute Engine (GCE) to work with HTTPS, but the remote server does not seem to respond when accessed via https://....

What I have tried so far:

I received a certificate from Comodo, put it on the backend, included it in the code, and created the HTTPS server as follows:

var app = express();
var https = require('https');
var fs = require('fs');

var options = {
  key: fs.readFileSync('server.key'),
  cert: fs.readFileSync('server.crt'),
};

...
        https.createServer(options,app).listen('443',function(){
                console.log('https ready')
        });

I also added the following firewall rule:

gcloud compute firewall-rules create allow-https --description "https server" --allow tcp:443
--format json

When I start the server on my local computer and try to access it using https://localhost:443Chrome, I get the expected:

This server cannot prove that it is localhost; his security certificate is located at www.domain_name.com. This may be due to an incorrect configuration or an attacker intercepting your connection.

, https, , .

:

GCE, , , . , tcpdump https:

tcpdump output for my case

netstat -ltnp :

  • https, , 443.

  • http 8080, , .

  • http https ( 8080 443), , . ...

: GCE https? ?

(q1, q2, q3, q4), , , , , .

+4
1

, , root, 443 ( ).

+1

Source: https://habr.com/ru/post/1614739/


All Articles