Skip to content

Commit

Permalink
build: fix compiling against openssl with no-psk
Browse files Browse the repository at this point in the history
fixes #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
  • Loading branch information
Caleb ツ Everett committed Jan 13, 2021
1 parent e2b954b commit 7f41ffd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/crypto/crypto_tls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1339,8 +1339,6 @@ int TLSWrap::SelectSNIContextCallback(SSL* s, int* ad, void* arg) {
return SSL_TLSEXT_ERR_OK;
}

#ifndef OPENSSL_NO_PSK

int TLSWrap::SetCACerts(SecureContext* sc) {
int err = SSL_set1_verify_cert_store(
ssl_.get(), SSL_CTX_get_cert_store(sc->ctx_.get()));
Expand All @@ -1355,6 +1353,8 @@ int TLSWrap::SetCACerts(SecureContext* sc) {
return 1;
}

#ifndef OPENSSL_NO_PSK

void TLSWrap::SetPskIdentityHint(const FunctionCallbackInfo<Value>& args) {
TLSWrap* p;
ASSIGN_OR_RETURN_UNWRAP(&p, args.Holder());
Expand Down

0 comments on commit 7f41ffd

Please sign in to comment.