The nodejs module is missing the SSL parameter to set the intermediary CA certificate. This intermediary is required for many certs, including GoDaddy's, and should be mapped to the 'ca' option of express.createServer().

The attached patch adds a new parameter to nodejs.config.js.example called sslCAPath, which defaults to ''.

Then inside server.js, an extra if/else block checks for whether it's defined and if so passes it in with the 'ca' parameter.

  // server.js line ~1017
var server;
if (settings.scheme == 'https') {
	if (settings.sslCAPath == '') {
	  server = express.createServer({
	    key: fs.readFileSync(settings.sslKeyPath),
	    cert: fs.readFileSync(settings.sslCertPath)
	  });
	}
	else {
	  server = express.createServer({
            key: fs.readFileSync(settings.sslKeyPath),
	    ca: fs.readFileSync(settings.sslCAPath),
	    cert: fs.readFileSync(settings.sslCertPath)
	  });
	}
}

Using this patch I can use my GoDaddy SSL certificate with nodejs.module.

Comments

damien_vancouver’s picture

Attached has some fixed extra whitespace.

damien_vancouver’s picture

Issue summary: View changes

fix whitespace

Anonymous’s picture

thanks! will review shortly.

Anonymous’s picture

Status: Needs review » Fixed

thanks, committed here:

http://drupalcode.org/project/nodejs.git/commit/0675db0

please reopen if you have any further issues with it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

add line number

  • Commit 0675db0 on 7.x-1.x, auth-refactor, 8.x-1.x, 8.x-1.x-head by beejeebus:
    #1601158: Add CA certificate option for SSL server.js, thanks...