Reputation: 28547
I have an Apache config for SSL like so:
SSLCertificateFile ~/certs/server.crt
SSLCertificateKeyFile ~/certs/server.key
SSLCertificateChainFile ~/certs/bundle.crt
Now in my NodeJs server, I am using grunt with grunt-connect as the server.
The documentation for grunt-connect
says that it can be configured using the following syntax.
grunt.initConfig({
connect: {
server: {
options: {
protocol: 'https',
port: 8443,
key: grunt.file.read('server.key').toString(),
cert: grunt.file.read('server.crt').toString(),
ca: grunt.file.read('ca.crt').toString()
},
},
},
});
I need this configuration to match my Apache configurations. It has a certificate file, and a key file, and also a bundle file.
Looking at the documentation for the tls.createServer in NodeJs,
I do not see an option that looks like it could be equivalent to SSLCertificateChainFile
.
How can I make my NodeJs connect server mirror the same SSL configuration as my Apache server?
I will also award the bounty to someone who can do this:
Create a SSCCE Gruntfile
that demonstrates how to configure connect
to accept a server certificate and bundle certificate.
Upvotes: 1
Views: 707
Reputation: 2384
You may try concatenating server.crt and ca.crt files in one file and using result in cert
option. Don't use ca
option, as per docs it is needed only 'if the client uses the self-signed certificate'.
Upvotes: 0