illuspas / Node-Media-Server

A Node.js implementation of RTMP/HTTP-FLV/WS-FLV/HLS/DASH/MP4 Media Server
https://www.npmjs.com/package/node-media-server
MIT License
5.91k stars 1.51k forks source link

Fail to run Node-Media-Server. #446

Closed hongyi-zhao closed 3 years ago

hongyi-zhao commented 3 years ago

On Ubuntu 20.04, I try to run Node-Media-Server git master version, but failed as shown below:

$ git clone https://github.com/illuspas/Node-Media-Server.git Node-Media-Server.git 
$ cd Node-Media-Server.git 
$ npm i

added 62 packages, and audited 63 packages in 1s

found 0 vulnerabilities
$ node app.js
4/14/2021 22:54:40 3371791 [INFO] Node Media Server v2.2.4
_tls_common.js:135
      c.context.setCert(cert);
                ^

Error: error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small
    at Object.createSecureContext (_tls_common.js:135:17)
    at Server (_tls_wrap.js:873:27)
    at new Server (https.js:62:14)
    at Object.createServer (https.js:85:10)
    at new NodeHttpServer (/home/werner/Public/repo/github.com/illuspas/Node-Media-Server.git/node_http_server.js:86:32)
    at NodeMediaServer.run (/home/werner/Public/repo/github.com/illuspas/Node-Media-Server.git/node_media_server.js:31:18)
    at Object.<anonymous> (/home/werner/Public/repo/github.com/illuspas/Node-Media-Server.git/app.js:42:5)
    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)

Any hints for solving this problem?

Regards, HY

BrianCF9 commented 3 years ago

estoy atrapado en el mismo error, por favor si alguien tiene la solucion:(

BrianCF9 commented 3 years ago

CREO QUE LO SOLUCIONE, SI BIEN MAS ABAJO ESTABA LA GENERACIÓN DE UNA NUEVA CLAVE CON 1024 BITS , HAY QUE CAMBIARLO POR 2048 POR LAS NUEVAS VERSIONES openssl genrsa -out privatekey.pem 2048 openssl req -new -key privatekey.pem -out certrequest.csr openssl x509 -req -in certrequest.csr -signkey privatekey.pem -out certificate.pem

hongyi-zhao commented 3 years ago

@BrianCF9 Thanks a lot, it does the trick.