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

Quickly fix incorrect err variable in example #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/onthefly.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function getHttpsOptionsFromDisk(domain, callback) {
} else {
fs.readFile(certificatesFolder + domain + '/key.pem', function(err2, keyData) {
if (err1) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably this line should be err2 then as well?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case, please also see https://github.com/Daplie/node-letsencrypt which is now actively maintained.

callback(err1);
callback(err2);
} else {
callback(null, {
key: keyData,
Expand Down Expand Up @@ -157,10 +157,10 @@ function startServer(handler, whitelist) {
if ('function' === typeof cb) {
cb(result);
}

return result;
}

if (contexts[servername]) {
console.log('SNI hit for ' + servername);
// io.js and node >= v0.11.5
Expand All @@ -186,7 +186,7 @@ function startServer(handler, whitelist) {
} else {
console.log('Rejected by whitelist function');
}

// node <= v0.11.4 mistakenly returns synchronously
if ('function' !== typeof cb) {
return shim(defaultContext);
Expand Down Expand Up @@ -235,7 +235,7 @@ startServer(function(req, res) {
// app.get('/', function (req, res) {
// res.send('Hello encrypted express world\n')
// });
//
//
// startServer(app, function(servername) {
// console.log('whitelist called for '+servername);
// return true;
Expand Down