Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start server missing fullchain.pem #4

Open
grootgordon opened this issue Aug 22, 2023 · 1 comment
Open

start server missing fullchain.pem #4

grootgordon opened this issue Aug 22, 2023 · 1 comment

Comments

@grootgordon
Copy link
Owner

grootgordon commented Aug 22, 2023

node:fs:603
handleErrorFromBinding(ctx);
^

Error: ENOENT: no such file or directory, open '/root/mediasoup-demo/server/certs/fullchain.pem'
at Object.openSync (node:fs:603:3)
at Object.readFileSync (node:fs:471:35)
at runHttpsServer (/root/mediasoup-demo/server/server.js:451:13)
at run (/root/mediasoup-demo/server/server.js:75:8)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/root/mediasoup-demo/server/certs/fullchain.pem'
}

Node.js v18.17.1

@grootgordon
Copy link
Owner Author

[root@centos8 certs]# openssl genrsa -out privkey.pem 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
..............................................................................................................+++++
...............+++++
e is 65537 (0x010001)
[root@centos8 certs]# openssl req -new -key privkey.pem -out csr.pem
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:
State or Province Name (full name) []:
Locality Name (eg, city) [Default City]:
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[root@centos8 certs]# 
[root@centos8 certs]# openssl x509 -req -days 365 -in csr.pem -signkey privkey.pem -out certificate.pem
Signature ok
subject=C = XX, L = Default City, O = Default Company Ltd
Getting Private key
[root@centos8 certs]# cat privkey.pem certificate.pem > fullchain.pem
[root@centos8 certs]# ls
certificate.pem  csr.pem  fullchain.pem  privkey.pem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant