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

Node 15.3.0 fails to build with shared-openssl with no-psk #36464

Closed
everett1992 opened this issue Dec 9, 2020 · 0 comments
Closed

Node 15.3.0 fails to build with shared-openssl with no-psk #36464

everett1992 opened this issue Dec 9, 2020 · 0 comments
Labels
build Issues and PRs related to build files or the CI.

Comments

@everett1992
Copy link
Contributor

  • Version: 15.3.0
  • Platform: Compiling on Ubuntu 18.04 but I beleive issue affects all platforms
  • Subsystem: build / compile

What steps will reproduce the bug?

Compile openssl with no-psk, compile node with shared-openssl

#!/bin/bash -x
set -euo pipefail

OPENSSL='openssl-1.1.1g'
NODE_VERSION='v15.3.0'
NODE="node-$NODE_VERSION"

main() {
  [ -d "$OPENSSL" ] || curl -sS https://www.openssl.org/source/"$OPENSSL".tar.gz | tar xz
  [ -d "$NODE" ] || curl -sS https://nodejs.org/dist/"$NODE_VERSION"/"$NODE".tar.gz | tar xz

  configure_make_openssl
  configure_make_node
}

configure_make_openssl() (
  cd "$OPENSSL"
  ./config no-psk

  make
)

configure_make_node() (
  cd "$NODE"
  export LD_LIBRARY_PATH=$(readlink -f ../$OPENSSL)
  ./configure \
    --shared-openssl \
    --shared-openssl-includes "$(readlink -f ../"$OPENSSL"/include)" \
    --shared-openssl-libpath "$(readlink -f ../"$OPENSSL")"

  make
)

main "$@"

no-psk errors

/node-v15.3.0/out/Release/obj.target/libnode/src/crypto/crypto_tls.o: In function `node::crypto::TLSWrap::SelectSNIContextCallback(ssl_st*, int*, void*)':
crypto_tls.cc:(.text+0x487b): undefined reference to `node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'
/node-v15.3.0/out/Release/obj.target/libnode/src/crypto/crypto_tls.o: In function `node::crypto::TLSWrap::CertCbDone(v8::FunctionCallbackInfo<v8::Value> const&)':
crypto_tls.cc:(.text+0x4c27): undefined reference to `node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'
collect2: error: ld returned 1 exit status
embedtest.target.mk:200: recipe for target '/node-v15.3.0/out/Release/embedtest' failed
make[1]: *** [/node-v15.3.0/out/Release/embedtest] Error 1
make[1]: *** Waiting for unfinished jobs....
/node-v15.3.0/out/Release/obj.target/libnode/src/crypto/crypto_tls.o: In function `node::crypto::TLSWrap::SelectSNIContextCallback(ssl_st*, int*, void*)':
crypto_tls.cc:(.text+0x487b): undefined reference to `node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'
/node-v15.3.0/out/Release/obj.target/libnode/src/crypto/crypto_tls.o: In function `node::crypto::TLSWrap::CertCbDone(v8::FunctionCallbackInfo<v8::Value> const&)':
crypto_tls.cc:(.text+0x4c27): undefined reference to `node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'
collect2: error: ld returned 1 exit status
mkcodecache.target.mk:203: recipe for target '/node-v15.3.0/out/Release/mkcodecache' failed
make[1]: *** [/node-v15.3.0/out/Release/mkcodecache] Error 1
/node-v15.3.0/out/Release/obj.target/libnode/src/crypto/crypto_tls.o: In function `node::crypto::TLSWrap::SelectSNIContextCallback(ssl_st*, int*, void*)':
crypto_tls.cc:(.text+0x487b): undefined reference to `node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'
/node-v15.3.0/out/Release/obj.target/libnode/src/crypto/crypto_tls.o: In function `node::crypto::TLSWrap::CertCbDone(v8::FunctionCallbackInfo<v8::Value> const&)':
crypto_tls.cc:(.text+0x4c27): undefined reference to `node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'

Node seems to aim to be compatible with no-psk because it checks for the definition of OPENSSL_NO_PSK

@Trott Trott added the build Issues and PRs related to build files or the CI. label Dec 12, 2020
everett1992 pushed a commit to everett1992/node that referenced this issue Jan 13, 2021
fixes nodejs#36464

Node 15 prior to this commit will not compile if openssl is built with
no-psk. Compiling emits an error like this:

```
crypto_tls.cc:(.text+0x4c27): undefined reference to `node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'
```

Blame on crypto_tls.cc shows the file was created in a refactor. Before
that refactor SetCACerts was defined outside OPENSSL_NO_PSK ifndef

https://github.com/nodejs/node/blob/6751b6dc3da102f259b74b7453032edadc7a37ca/src/crypto/crypto_ssl.cc#L839
@aduh95 aduh95 closed this as completed in fef2128 Jan 19, 2021
ruyadorno pushed a commit that referenced this issue Jan 22, 2021
Node 15 prior to this commit will not compile if openssl is built with
no-psk. Compiling emits an error like this:

```
crypto_tls.cc:(.text+0x4c27): undefined reference to
`node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'
```

Blame on crypto_tls.cc shows the file was created in a refactor. Before
that refactor SetCACerts was defined outside OPENSSL_NO_PSK ifndef.

PR-URL: #36881
Fixes: #36464
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
ruyadorno pushed a commit that referenced this issue Jan 25, 2021
Node 15 prior to this commit will not compile if openssl is built with
no-psk. Compiling emits an error like this:

```
crypto_tls.cc:(.text+0x4c27): undefined reference to
`node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'
```

Blame on crypto_tls.cc shows the file was created in a refactor. Before
that refactor SetCACerts was defined outside OPENSSL_NO_PSK ifndef.

PR-URL: #36881
Fixes: #36464
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants