Tag: https

浏览器同步和代客安全

我使用浏览器同步服务我的本地开发网站。 我也使用Laravel代客。 当我使用valet secure通过https服务一个开发网站,我得到那些丑陋的Chrome隐私错误页面。 有没有办法阻止这个? 我的浏览器同步configuration如下: browserSync.init({ host: "https://mysite.dev", proxy: "https://mysite.dev", … mysite.dev从一个站点到mysite.dev站点的变化,我有很多本地开发工具我在工作。 当我运行npm start浏览器同步输出: [BS] Proxying: https://mysite.dev [BS] Access URLs: —————————————— Local: https://localhost:3000 External: https://https://mysite.dev:3000 —————————————— UI: http://localhost:3001 UI External: http://https:3001 正如你可以看到它正确映射的url,如果我忽略Chromes隐私错误警告,我可以看到网站罚款。 我只是想知道为什么HTTPS不能正常工作。 如果我访问https://mysite.dev 没有浏览器同步:3000端口,它在Chrome中工作正常,并说地址栏上的“安全”

如何正确创build一个HTTPS透明代理服务器与节点?

我使用的npm包http-proxy声称帮助,但我完全无法使其工作。 到目前为止,我只通过制作一个透明的HTTP代理服务器来获得成功,但是当它创build一个透明的HTTPS代理服务器时,则什么都不会发生。 我正在使用一个Android设备,configuration为使用代理服务器期望configuration的端口的代理,但在nodejs端没有任何东西被触发。 只有当我configuration了一个HTTP代理服务器,那么事情似乎正在工作。 这是我用于HTTPS的代码: var https = require('https'); var fs = require('fs'); var httpProxy = require('http-proxy'); var options = { key: fs.readFileSync('./client-key.pem', 'utf8'), cert: fs.readFileSync('./client-cert.pem', 'utf8') }; var proxy = httpProxy.createProxyServer({ ssl: options }); https.createServer(options, function (req, res) { console.log("new", req.url); proxy.web(req, res, { target: req.url }); }).listen(8000); 如果我使用http包中的createServer,那么它适用于http调用(因为callback被触发),但是它不适用于使用这些指令的https。 任何人都知道我做错了什么? PS:我不在乎是否必须使用不同的npm包。

向NodeJS + SocketIO添加HTTPS

我正在使用NodeJS和SocketIO创build应用程序,并希望添加HTTPS支持。 目前,我的应用程序按照预期与http。 var http = require('http'); var socketIO = require('socket.io'); var fileServer = new(nodeStatic.Server)(); var server = http.createServer(function(req, res) { fileServer.serve(req, res); }).listen(8080); var io = socketIO.listen(server); io.sockets.on('connection', function(socket) { … 这对我来说是完美的。 我尝试添加以下HTTPS支持: var https = require('https'); var fs = require('fs'); var socketIO = require('socket.io'); var options = { key: fs.readFileSync('key.pem'), cert: fs.readFileSync('cert.pem') }; var […]

节点v7.9.0的ERR_SSL_VERSION_OR_CIPHER_MISMATCH https

此代码在节点v7.9.0(Electron当前使用的版本)中创build一个https服务器,并在端口8000上侦听: require('https').createServer( {}, (req, res) => { res.writeHead(200); res.end('hello world/n'); } ).listen(8000); 不幸的是,当我访问https:// localhost:8000在服务器运行时,我得到了ERR_SSL_VERSION_OR_CIPHER_MISMATCH。 我怎样才能通过这个错误? 如何找出哪些服务器可用的密码以及它正在使用的协议(希望是最新版本的TLS)? 编辑这个错误也发生在节点v8.5.0,在编写时最新的稳定版本的节点

使用nodeJS检查其他域SSL证书

我需要检查给定的域是否有一个有效的SSL证书使用NodeJS,所以我使用https模块是这样的: const https = require('https'); const options = { host: 'www.some-site.com', method: 'get', path: '/' }; const req = https.request(options, res => { console.log('Certificate Status: ', res.socket.authorized); }); req.on('error', error => { console.error('Error: ', error); }); req.end(); 我一直在对一些列在Google透明度报告中的网站进行testing: https : //transparencyreport.google.com/https/top-sites 一些结果: aliexpress.com – Certificate Status: true正确 expired.badssl.com – Certificate Status: false正确 两者都正确。 但是,当一个站点没有使用SSL时, socket.authorized所有值仍然是正确的: […]

Node.js – 在运行时dynamic更改HTTPS服务器的SSL证书

我正在build立一个HTTPS代理node 。 基本上,我允许用户为我的代理服务器设置一个DNS CNAME别名,并将他们的SSL证书导入到我的应用程序中(例如AWS Elastic Load Balancer),以便他们的CNAME主机名得到适当的保护,每一个请求都被客户认可。 现在我正在代理端工作,我试图find一种方法来在与客户端的SSL握手之前dynamic地加载正确的证书。 工作stream程是: 服务器收到新的请求 获取客户端请求的主机名(即用户设置的DNS CNAME别名) 加载属于该主机名的正确证书 在当前请求中使用加载的证书 (需要帮助) 握手(加载的证书 – 因请求而异) 有没有办法做到这一点?

在nodejs express中运行https服务器时,ERR_SSL_PROTOCOL_ERROR浏览器错误消息

我使用下面的代码在Express上运行了许多nodejs应用程序。 他们都运行良好使用代码类似于以下内容: fs = require 'fs' https = require 'https' express = require 'express' server_port = 3000 keys_dir = 'keys/' server_options = { key : fs.readFileSync(keys_dir + 'privatekey.pem'), cert : fs.readFileSync(keys_dir + 'certificate.pem') } app = express.createServer(server_options) app.listen server_port console.log "HTTPS Server started on port #{server_port}" 但是,当尝试使用此代码创build新应用程序时,在启动https服务器时会看到一个ERR_SSL_PROTOCOL_ERROR。 任何想法是什么导致这个问题?

将通知系统更改为SSL(目前在Chrome中使用https时因为使用http而被阻止)

我在我的网站有一个通知系统,我正在尝试将其从http更改为https。 但是我的app.js现在正在上传到8888端口。 有一个快速的方法,我可以修改它? 我在网上尝试了几种方法,但没有成功。 (现在我的curl是类似于http://myipaddress:8888 ) 非常感谢! 对此,我真的非常感激。 /* CONFIGURATION */ /* Web Server Config */ var _postpath = '/send'; var _listenport = 8888; var _listenaddr = '0.0.0.0'; //use '0.0.0.0' to listen on all interfaces /* Slave (sub) Redis Server Config */ var _channelfilter = '*'; var _sub_db_addr = '127.0.0.1'; var _sub_db_passwd_protected = true; var […]

Node.js的内部证书颁发机构(CA)https.request:如何指向.PEM?

我最近从节点0.8.xx更新到0.10.5。 突然,我的https.request调用开始失败。 我相信0.8.x没有validation证书,但0.10.5是。 我们设置了一些内部authentication中心来validation内部httpsstream量。 我想显示Node.js https.request客户端的证书。 我该怎么做呢? 目前,我得到: Problem with request: UNABLE_TO_VERIFY_LEAF_SIGNATURE 我努力了: var https_request_options = { host: 'myhost.com', path: '/thepath', port: 443, method: 'POST', headers: { 'Content-type': "application/x-www-form-urlencoded", 'Content-length': thebody.length, }, // rejectUnauthorized: false, ca: [fs.readFileSync('/whatever/path/ca_certs.pem')] }; var authRequest = https.request(https_request_options, function(response) { …. 如果我设置rejectUnauthorized: false ,调用工作,但我想开始利用节点0.10.5中的改进的安全性。 我相信我的.pem文件是好的,因为它可以与Python httplib2($ {python} /Lib/site-packages/httplib2/cacerts.txt)和cURL(“curl-ca-bundle.crt”)一起使用。

Nodejs – Socketio不与https服务器,可能是什么原因?

我尝试使用http服务器debugging,并且socket.io工作,但是当我尝试使用https socket.io停止工作 // create server for http and https //var httpserver = http.createServer(app).listen('3000', '127.0.0.1'); var https_server = https.createServer(options, app).listen('4000', '127.0.0.1'); // let the backend listens to this server UserServer.listen(https_server); //UserServer.listen(httpserver); exports.listen = function(server){ io = socketio.listen(server); io.sockets.on('connection', function(socket){ console.log("Socket is connected, sweet "); }); } 什么时候 var httpserver = http.createServer(app).listen('3000', '127.0.0.1'); UserServer.listen(httpserver); 打印 Socket is […]