Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Server Key Error #33

Open
krishnakanthpps opened this issue Jul 2, 2020 · 13 comments
Open

Server Key Error #33

krishnakanthpps opened this issue Jul 2, 2020 · 13 comments

Comments

@krishnakanthpps
Copy link

Hi..

Wanted to try this MCU module. Getting the following error.

root@ubuntu-s-1vcpu-2gb-nyc1-01:~/media-server-demo-node# node index.js 192.241.132.6
[0x7f32161ab740][1593716900.856][LOG]>RTPBundleTransport::Init()
[0x7f32161ab740][1593716900.856][LOG]-RTPBundleTransport::Init() | Got port [50977]
[0x7f32161ab740][1593716900.856][LOG]<RTPBundleTransport::Init()
fs.js:114
throw err;
^

Error: ENOENT: no such file or directory, open 'server.key'
at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
at Object. (/root/media-server-demo-node/index.js:22:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)

Here are the steps I followed.

git clone https://github.com/medooze/media-server-demo-node.git
ls
cd media-server-demo-node/
ls
npm install
npm audit fix
ls
npm index.js 192.241.132.6
node index.js 192.241.132.6
history

@enderocean
Copy link

Hi,
Just installed a self-signed certificated in "media-server-demo-node" directory :

cd media-server-demo-node/
sudo apt-get install openssl
openssl genrsa -des3 -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.cert

It works.

@Asim187
Copy link

Asim187 commented Sep 17, 2020

after running node index.js

i am getting following error

[0x7fcb87035740][1600323514.310][ERR]-DTLSConnection::Initialize() | Specified certificate file '' could not be used
[0x7fcb87035740][1600323514.311][LOG]>RTPBundleTransport::Init()
[0x7fcb87035740][1600323514.311][LOG]-RTPBundleTransport::Init() | Got port [56905]
[0x7fcb87035740][1600323514.312][LOG]<RTPBundleTransport::Init()
[0x7fcb87035740][1600323514.313][LOG]-RTPTransport::SetPortRange() | configured RTP/RTCP ports range [10000,20000]
[0x7fcb87035740][1600323514.339][LOG]>RTPTransport::Init()
[0x7fcb87035740][1600323514.339][LOG]-RTPTransport::Init() | Got ports [5004,5005]
[0x7fcb87035740][1600323514.339][LOG]<RTPTransport::Init()

@newmips
Copy link

newmips commented Sep 17, 2020

I have cloned last master version of repository and executed the following commands:

openssl genrsa -aes128 -out server.key 2048 

Type "mypasswd" when asked for password

openssl rsa -passin pass:mypasswd -in server.pass.key -out server.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.cert
node index.js 127.0.0.1

Can you do the same and tell me if it works?

@Asim187
Copy link

Asim187 commented Sep 19, 2020

@newmips getting the following error after executing
openssl rsa -passin pass:mypasswd -in server.pass.key -out server.key

Can't open server.pass.key for reading, No such file or directory
140433960330560:error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:69:fopen('server.pass.key','r')
140433960330560:error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:76:
unable to load Private Key

@newmips
Copy link

newmips commented Sep 19, 2020

Sorry... "server.pass.key is only generated if you executes:

openssl genrsa -des3 -out server.pass.key 2048

@Asim187
Copy link

Asim187 commented Sep 19, 2020

@newmips still getting same error

node index.js 127.0.0.1
[0x7fe958cb2740][1600526338.243][ERR]-DTLSConnection::Initialize() | Specified certificate file '' could not be used
[0x7fe958cb2740][1600526338.244][LOG]>RTPBundleTransport::Init()
[0x7fe958cb2740][1600526338.245][LOG]-RTPBundleTransport::Init() | Got port [44494]
[0x7fe958cb2740][1600526338.245][LOG]<RTPBundleTransport::Init()
[0x7fe958cb2740][1600526338.246][LOG]-RTPTransport::SetPortRange() | configured RTP/RTCP ports range [10000,20000]
[0x7fe958cb2740][1600526338.271][LOG]>RTPTransport::Init()
[0x7fe958cb2740][1600526338.271][LOG]-RTPTransport::Init() | Got ports [5004,5005]
[0x7fe958cb2740][1600526338.272][LOG]<RTPTransport::Init()

what do i need to enter A challenge password during SSL installation i entered mypasswd. is that correct ?

@newmips
Copy link

newmips commented Sep 20, 2020

No. You just need to enter mypasswd for the passphrase (when you generate the key).
When prompt for A challenge password , you must leave it like that and press Enter key

@Asim187
Copy link

Asim187 commented Sep 20, 2020 via email

@newmips
Copy link

newmips commented Sep 20, 2020

Are you logged as sudo ?
Here come my logs after sudo npm install cloned repository:

root@denis-N501JW:/home/denis/tmp/media-server-demo-node# openssl genrsa -des3 -out server.pass.key 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
.............................................+++++
...................................................+++++
e is 65537 (0x010001)
Enter pass phrase for server.pass.key:
Verifying - Enter pass phrase for server.pass.key:
root@denis-N501JW:/home/denis/tmp/media-server-demo-node# openssl rsa -passin pass:mypasswd -in server.pass.key -out server.key
writing RSA key
root@denis-N501JW:/home/denis/tmp/media-server-demo-node# openssl req -new -key server.key -out server.csr
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) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
root@denis-N501JW:/home/denis/tmp/media-server-demo-node# openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.cert
Signature ok
subject=C = AU, ST = Some-State, O = Internet Widgits Pty Ltd
Getting Private key
root@denis-N501JW:/home/denis/tmp/media-server-demo-node# node index.js 127.0.0.1
[0x7f51643d0740][1600590031.530][LOG]>RTPBundleTransport::Init()
[0x7f51643d0740][1600590031.530][LOG]-RTPBundleTransport::Init() | Got port [52144]
[0x7f51643d0740][1600590031.530][LOG]<RTPBundleTransport::Init()
[0x7f51643d0740][1600590031.530][LOG]-RTPTransport::SetPortRange() | configured RTP/RTCP ports range [10000,20000]
[0x7f51643d0740][1600590031.547][LOG]>RTPTransport::Init()
[0x7f51643d0740][1600590031.547][LOG]-RTPTransport::Init() | Got ports [5004,5005]
[0x7f51643d0740][1600590031.547][LOG]<RTPTransport::Init()

Relevant files are in application directory:

root@denis-N501JW:/home/denis/tmp/media-server-demo-node# ls
index.js  lib  LICENSE  node_modules  package.json  package-lock.json  README.md  recordings  server.cert  server.csr  server.key  server.pass.key  www

@Asim187
Copy link

Asim187 commented Sep 20, 2020 via email

@AlexLionne
Copy link

Hi,
Just installed a self-signed certificated in "media-server-demo-node" directory :

cd media-server-demo-node/
sudo apt-get install openssl
openssl genrsa -des3 -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.cert

It works.

Hi, I followed exaclty your steps and still got an issue with

DTLSConnection::Initialize() |
Specified certificate file '' could not be used

@newmips
Copy link

newmips commented Nov 28, 2020

Are you logged as root ? Have you checked you have execution rights ? chmod +x server.*

@AlexLionne
Copy link

Yes I am but nvm I found it :) thanks

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

No branches or pull requests

5 participants