There's an .env file with following content in the root directory of the react app:
HTTPS=true
SSL_CRT_FILE=/ssl/certificate.crt
SSL_KEY_FILE=/ssl/certificate.key
/app/myProjectPath:
total used in directory 484 available 1731267132
drwxrwxrwx 1 user Domänen-Benutzer 8192 06-16 19:17 ..
drwxrwxrwx 1 user Domänen-Benutzer 4096 06-21 10:59 .
-rw-rw-rw- 1 user Domänen-Benutzer 82 06-22 17:18 .env
drwxrwxrwx 1 user Domänen-Benutzer 4096 06-21 10:59 .git
-rw-rw-rw- 1 user Domänen-Benutzer 324 2020-06-20 .gitignore
-rw-rw-rw- 1 user Domänen-Benutzer 1067 06-21 10:56 node_modules
-rw-rw-rw- 1 user Domänen-Benutzer 759 06-21 10:59 package.json
-rw-rw-rw- 1 user Domänen-Benutzer 753 06-16 19:28 package.json.bkp
-rw-rw-rw- 1 user Domänen-Benutzer 176 2020-11-12 post.sh
drwxrwxrwx 1 user Domänen-Benutzer 4096 06-16 19:17 public
-rw-rw-rw- 1 user Domänen-Benutzer 9830 06-16 19:17 README.md
drwxrwxrwx 1 user Domänen-Benutzer 4096 06-16 19:17 src
-rw-rw-rw- 1 user Domänen-Benutzer 457759 2020-06-20 yarn.lock
When the server starts, I've got the output:
> react-template@0.1.0 start /app/myProjectPath
> react-scripts start
certificate.crt file exists.
certificate.key file exists.
Starting the development server...
Compiled successfully!
You can now view react-template in the browser.
https://localhost:3000/
Note that the development build is not optimized.
To create a production build, use yarn build.
To ensure that both the certificate and key file can be read by node.js, I've added some debug code inside start.js:
if(fs.existsSync('/ssl/certificate.crt')) {
console.log("certificate.crt file exists.");
} else {
console.log('certificate.crt file does not exist.');
}
if(fs.existsSync('/ssl/certificate.key')) {
console.log("certificate.key file exists.");
} else {
console.log('certificate.key file does not exist.');
}
As you can see in the output above, both files could be read at startup.
If I call https://localhost:3000 I've got different browser error messages:
Firefox 89: SEC_ERROR_INADEQUATE_KEY_USAGE
Chrome 88: NET::ERR_CERT_AUTHORITY_INVALID
The same key and certificate files are working well in a simple Apache https config, so I assume the certificate and its key are issued correctly.
So what's wrong with node.js https development server here?
There's an .env file with following content in the root directory of the react app:
When the server starts, I've got the output:
To ensure that both the certificate and key file can be read by node.js, I've added some debug code inside start.js:
As you can see in the output above, both files could be read at startup.
If I call https://localhost:3000 I've got different browser error messages:
Firefox 89: SEC_ERROR_INADEQUATE_KEY_USAGE
Chrome 88: NET::ERR_CERT_AUTHORITY_INVALID
The same key and certificate files are working well in a simple Apache https config, so I assume the certificate and its key are issued correctly.
So what's wrong with node.js https development server here?