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

Creating certificate fails on Windows. #7

Closed
hmbrg opened this issue Feb 20, 2016 · 6 comments
Closed

Creating certificate fails on Windows. #7

hmbrg opened this issue Feb 20, 2016 · 6 comments

Comments

@hmbrg
Copy link

hmbrg commented Feb 20, 2016

This is the error I get:

D:\SOMEPROJECT\node_modules\auto-sni\lib\index.js:54
    .once('close', httpServer.close.bind(httpServer))
                             ^
TypeError: Cannot read property 'close' of undefined

That's what my server.js looks like:

var express = require('express');
var createServer = require("auto-sni");


var app = express();

app.get('/', function (req, res) {
       //SOME ACTION
});

createServer({ 
    email: "EMAIL", 
    agreeTos: true,
    debug: true,
    ports: {
        http: 8000, 
        https: 8443
    }
}, app);

What am I doing wrong here?

@DylanPiercey
Copy link
Owner

What version of node are you using?

@hmbrg
Copy link
Author

hmbrg commented Feb 20, 2016

Well, I was using v0.1.12, I'm a little bit ashamed right now... Updated to v4 and I get another error:

Subject does not start with '/'.
problems making Certificate Request
]
  killed: false,
  code: 1,
  signal: null,
  cmd: 'C:\\WINDOWS\\system32\\cmd.exe /s /c "openssl req -x509 -newkey rsa:2048 -keyout privkey.pem -out cert.pem -days 90 -nodes -subj \'/CN=localhost/emailAddress=EMAIL\' && cat privkey.pem cert.pem | tee -a chain.pem fullchain.pem"' }
Will fall back to self signed certificate.

This error gets repeated in an infinite loop.
The openssl command is working and openssl is installed.

@DylanPiercey
Copy link
Owner

I haven't tested this on Windows, could you try executing the failed command above without the first "/" before "CN="? If that successfully creates a self signed certificate then I should be able to issue a patch for Windows.

@hmbrg
Copy link
Author

hmbrg commented Feb 20, 2016

Ok I tested that, the problem seems to be that operators like && don't work in the Windows CMD.

@DylanPiercey
Copy link
Owner

@brighthero Thanks for looking into it. I'll see what I can do sometime this weekend, if you have time a PR would be great.

@DylanPiercey DylanPiercey changed the title error when using with express Creating certificate fails on windows. Feb 20, 2016
@DylanPiercey DylanPiercey changed the title Creating certificate fails on windows. Creating certificate fails on Windows. Feb 20, 2016
@DylanPiercey
Copy link
Owner

Going to close this for now since it seems dead in the water and I have opted to avoid supporting windows for now. PR's always welcome though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants