码迷,mamicode.com
首页 > Web开发 > 详细

nodejs 里https的开启

时间:2018-07-31 13:36:18      阅读:340      评论:0      收藏:0      [点我收藏+]

标签:key   func   als   ejs   function   read   fun   ica   %s   


var privateKey = fs.readFileSync(‘./key/214278976170532.key‘, ‘utf8‘);
var certificate = fs.readFileSync(‘./key/214278976170532.pem‘, ‘utf8‘);
var credentials = {key: privateKey, cert: certificate};


var SSLPORT = 443;
var privateKey = fs.readFileSync(‘./key/214278976170532.key‘, ‘utf8‘);
var certificate = fs.readFileSync(‘./key/214278976170532.pem‘, ‘utf8‘);
var credentials = {key: privateKey, cert: certificate};
https.createServer(credentials, server).listen(SSLPORT, function () {
console.log(‘HTTPS Server is running on: https://localhost:%s‘, SSLPORT);
});

nodejs 里https的开启

标签:key   func   als   ejs   function   read   fun   ica   %s   

原文地址:https://www.cnblogs.com/adjk/p/9395015.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!