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

agregar certificado ssl para conexion https x red #23

Open
ftoledo opened this issue Aug 7, 2022 · 1 comment
Open

agregar certificado ssl para conexion https x red #23

ftoledo opened this issue Aug 7, 2022 · 1 comment

Comments

@ftoledo
Copy link
Member

ftoledo commented Aug 7, 2022

ver si queda funciona con la generacion de forma dinamica del certiifcado con openssl
como son autofirmados probar si chrome permite usar la camara con un certificado no seguro.

@ftoledo
Copy link
Member Author

ftoledo commented Aug 7, 2022

para escuchar via https desde express:

var express = require('express');
var https = require('https');
var http = require('http');
var fs = require('fs');
var app = express();

var options = {
  key: fs.readFileSync('/path/to/key.pem'),
  cert: fs.readFileSync('/path/to/cert.pem'),
  ca: fs.readFileSync('/path/to/ca.pem')
};

http.createServer(app).listen(80);
https.createServer(options, app).listen(443);

el CA parece ser opcional

otro ejemplo:

var privateKey = fs.readFileSync( 'privatekey.pem' );
var certificate = fs.readFileSync( 'certificate.pem' );

https.createServer({
    key: privateKey,
    cert: certificate
}, app).listen(port);

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