Tag: ssl

跨平台(包括Windows)的方式使用操作系统信任的证书与nodejs

是否有可用的节点模块或者可以通过跨平台方式从操作系统读取可信证书的代码? 其他答案涵盖了如何使用ubuntus ,我可以适应MacOS X,但我一直没能find任何代码,可以轻松地读取Windows受信任的证书。 其他问题指出了它们在registry中存在的位置,我应该使用CryptoAPI来加载它们,但是我还没有find一个从节点执行此操作的好例子。

如何使用create-react-app提供SSL证书?

我正在尝试使用Facebook样板在本地创build和testing一个反应应用程序。 客户端应用程序与我使用node.js制作的API进行交互,并且我没有设置安全连接(使用node.js客户端发送我的SSL证书进行testing)。 然而,我遇到了困难,当谈到使用反应发送我的SSL证书而不是一个自签名的使我遇到这个错误使用铬并试图访问https://example.net:3000 : 您的连接不是私有的(NET:ERR_CERT_AUTHORITY_INVALID) 这个文档对我没有太大的帮助: 请注意,服务器将使用自签名证书,因此您的Web浏览器在访问该页面时几乎肯定会显示警告。 https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#using-https-in-development 我如何使用自己的SSL证书(我已经在我的域名上使用另一个应用程序,像魅力一样),而不是自签名的? 我错过了什么 ?

无法在我的node.js项目的wamp套接字中configurationssl

我用angular-wamp作为客户端, Crossbar作为路由器。 当我没有ssl(https)使用它时,WAMP是完美的工作。 但是当我试图实现安全的WebSocket它给这样的错误在控制台中: WAMP connection closed unreachable { reason: null, message: null, retry_delay: 2.052066390813223, retry_count: 2, will_retry: true } 但在浏览器中显示恭喜! 你连接到WAMP服务器! 我已经使用wss:// localhost:8080 / ws作为连接的URL。 使用此链接作为参考https://github.com/crossbario/crossbarexamples Node.js服务器在3000端口上运行。 卡住严重,任何帮助将不胜感激。 我已经接受了本地主机以及127.0.0.1的临时不安全authentication(通常是我们的自我authentication),但仍然得到了以下的东西。 在浏览器日志中: 恭喜! 你连接到WAMP服务器! 我已经接受了自签名authentication(localhost和127.0.0.1):

将Heroku App连接到Atlas MongoDB Cloud服务

为了解决这个问题:是否需要在Heroku上获得SSL支持才能使用SSLbuild立Heroku与Atlas MongoDB Cloud之间的连接? (TSL / SSL连接是访问Atlas MongoDB云服务的要求 )。 我正在尝试将使用node.js编写的Heroku应用程序连接到Atlas MongoDB Cloud托pipe的集群。 我当前的数据库是在mLab(作为Heroku插件)托pipe的,用于通过mongoose访问集群的MongoDB URI是(使用xxx来省略保密信息): MONGODB_URI="mongodb://xxx:xxx@xxx-a0.mlab.com:23266,xxx-a1.mlab.com:xxx/xxx?replicaSet=rs-xxx" 现在我已经将数据从mLab迁移到Atlas MongoDB Cloud,我正在使用URI访问集群: MONGODB_URI="mongodb://xxx:xxx@cluster0-shard-xxx.mongodb.net:xxx,cluster0-shard-xxx.mongodb.net:xxx,cluster0-shard-xxx.mongodb.net:xxx/xxx?replicaSet=xxx&ssl=true&authSource=admin" 当我的机器在本地运行我的Heroku应用程序时,我可以访问数据库没有问题。 我也可以使用mongo shell连接到群集。 但是,在Heroku中运行App时,无法build立连接。 在浏览器JS控制台,我得到503服务不可用消息。 在heroku中,我得到错误: no primary found in replica set 我知道Atlas MongoDB Cloud需要SSL连接,与mLab不同。 在我的本地机器上,我想使用自签名证书来成功连接到群集。 我的问题是:我是否需要在Heroku中获得SSL支持才能访问build立Heroku和MongoDB Atlas之间的安全连接? 或者Heroku中的SSL suport只需要客户端/ Heroku安全连接?

SSL证书Socket.io

我已经创build了自己的Livechat,它工作正常,但是在我试图添加我的SSL证书后,它不能正常工作了。 我尝试了不同的代码。 var fs = require('fs'); var express = require("express"); var options = { key: fs.readFileSync('ca.key'), cert: fs.readFileSync('ca.crt') }; var expres = express() , app = require('https').createServer(options, expres) , io = require('socket.io').listen(app, { }); app.listen(8080); 和 var fs = require('fs'); var express = require("express"); var options = { key: fs.readFileSync('ca.key'), cert: fs.readFileSync('ca.csr'), ca: fs.readFileSync('ca.crt'), requestCert: […]

Node.js上的服务器HTTPS不起作用

我正在尝试创build一个HTTPS服务器。 我已经按照以下说明使用Cygwin64生成了privatekey.pem和certicate.pem: openssl genrsa -out privatekey.pem 1024 openssl req -new -key privatekey.pem -out certrequest.csr openssl x509 -req -in certrequest.csr -signkey privatekey.pem -out certificate.pem 而我的服务器代码是这样的: var https = require('https'); var fs = require('fs'); var options = { key: fs.readFileSync('privatekey.pem'), cert: fs.readFileSync('certificate.pem') }; https.createServer(options, function (req, res) { res.writeHead(200); res.end("hello world\n"); }).listen(8001); 当我尝试连接到地址https://localhost:8001 ,网页不可用。 谁能帮我?

需要SSL证书的Nodejs / Socketio级别

我希望使用带有socketio和nodejs的安全websocket,以便我的更多移动通信/公司networking可以使用websocket。 大多数浏览器需要什么级别的SSL证书来接受证书/服务器的可信度。 就我所知,浏览器没有用于审查/允许websockets的SSL连接的接口,那么他们如何处理他们不信任的证书呢? 他们只是拒绝连接? 从示例列表中需要什么最低级别: https : //www.123-reg.co.uk/ssl-certificates/并且有人对Web浏览器连接中的各种级别的SSL进行处理做了任何研究?

FileSync没有find我的文件

FileySync没有find其他模块find的子文件夹(我也试过相同的文件夹)中的文件。 console.log __dirname https = require('https') fs = require('fs') sslOptions = { key: fs.readFileSync('./config/ssl/server.key'), cert: fs.readFileSync('./config/ssl/server.crt'), ca: fs.readFileSync('./config/ssl/ca.crt'), requestCert: true, rejectUnauthorized: false } secureServer = https.createServer(sslOptions,app).listen('3030', () -> console.log("Secure Express server listening on port 3030") ) configDB = require('./config/database.js')(environment) finddatabase.js,ssl文件没有。 logging的dirname: —my project folder–/.tmp/serve 文件权限: configuration -rw-r–r– 1 MasterG staff 93 14 Apr 14:06 config.js […]

Websocket SSL连接

我试图testing一个安全的websocket,但我遇到了麻烦。 这是我的testing: var WebSocket = require('ws'); describe('testing Web Socket', function() { it('should do stuff', function(done) { var ws = new WebSocket('wss://localhost:15449/', { protocolVersion: 8, origin: 'https://localhost:15449' }); ws.on('open', function() { console.log('open!!!'); done(); }); console.log(ws); }); }); 这是创build后的“ws”日志: { domain: null, _events: { open: [Function] }, _maxListeners: undefined, _socket: null, _ultron: null, _closeReceived: false, bytesReceived: 0, […]

缺lessPFX或证书+私钥

我已经将键设置为node.js,但仍然无法使其工作。 有人可以告诉我该怎么做,才能正常工作。 我需要使用https和node.js一起工作。 我得到以下错误。 `tls.js:1127 throw new Error('Missing PFX or certificate + private key.'); ^ Error: Missing PFX or certificate + private key. at Server (tls.js:1127:11) at new Server (https.js:35:14) at Object.exports.createServer (https.js:54:10) at Object.<anonymous> (/var/www/html/fusionmate/nodejs/server.js:4:36) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16)` 她的我的代码 […]