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

Under Windows, node-gyp provides headers but not linkable libraries for OpenSSL #874

Closed
murgatroid99 opened this issue Jan 28, 2016 · 13 comments

Comments

@murgatroid99
Copy link

This prevents users from using any OpenSSL library whose version does not match the provided headers, and it prevents library authors from shipping alternatives to OpenSSL.

In general, a library should not provide headers for symbols that its linkable libraries do not expose.

@bnoordhuis
Copy link
Member

You should file that over at https://github.com/nodejs/node/issues. It's possible an issue already exists. The .lib files are created by the node.js release team, node-gyp only downloads them.

FWIW, on UNIX, the node binary reexports the symbols from OpenSSL. I don't know how it's configured on Windows.

@murgatroid99
Copy link
Author

Thanks for the pointer.

I am definitely sure that node-gyp gives link failures if I attempt to use OpenSSL symbols on Windows, and that the downloaded node.lib file does not have any OpenSSL symbols. Plus, your own wiki's instructions imply that this is the case.

@TooTallNate
Copy link
Contributor

@TooTallNate
Copy link
Contributor

Whoops, sorry, didn't see that your link to the wiki page that you already found.

@murgatroid99
Copy link
Author

OK, I opened an issue at nodejs/node#4932

@drFabio
Copy link

drFabio commented Jul 28, 2016

I am trying to statically link the openSSL like the wiki but on electron (Can't use bundle because electron changes openSSL to borinSSL and also I am on windows).It seems the user still needs some openSSL dlls, shouldn't the static library provide anything he needs ?

@rvagg
Copy link
Member

rvagg commented Jul 28, 2016

@drFabio you're going to have to manage this yourself unfortunately. Download OpenSSL, put it in a predictable location and link to it. There are basic headers in the headers tarball but you don't get anything beyond that from Node.

@drFabio
Copy link

drFabio commented Jul 28, 2016

Yeah I did that using a fixed location and adding the '-l<(openssl_root)/lib/libeay32.lib', it compiles but on machines without openssl it launches a dlopen error.

@drFabio
Copy link

drFabio commented Jul 28, 2016

Well @rvagg I need to add the libeay32.dll alongside the electron executable for some reason for this to work. Just linking did not worked. don't know why

@bnoordhuis
Copy link
Member

@drFabio As of node.js v6.3.0, node exports the openssl symbols on Windows. Perhaps you can lobby Electron to pick up the relevant commit, nodejs/node@15a32dd?

@drFabio
Copy link

drFabio commented Jul 29, 2016

Electron changes the openSSL to borinSSL because of chromium so any openSSL addon needs to be done as if openSSL is not acessible (because it is not). I think I will just pack the dll alongside it

@bnoordhuis
Copy link
Member

bnoordhuis commented Jul 30, 2016

I'm aware it uses BoringSSL but my thinking was that the script that is used to generate the symbols for OpenSSL can be reused.

I see that the *.num files that are used as inputs have been removed in BoringSSL master though, so that is not going to work long-term.

@drFabio
Copy link

drFabio commented Aug 1, 2016

Yeah, they advised against using or trusting anything OpenSSL to be available at the near future. I will just ship the dll on windows, the static linking on linux seems to be working though. Thanks for your time

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

No branches or pull requests

5 participants