Skip to content

Support OpenSSL 3.0 Legacy provider in version 16 #40948

Description

@herbrechtsmeier

Node v16 supports dynamically linking with OpenSSL 3.0 (#29817) but doesn't support OpenSSL 3.0 Legacy provider (#40455). Please backport 86d1c0c or always load the legacy provider for OpenSSL 3.0.

Activity

  1. added
    opensslIssues and PRs related to the OpenSSL dependency.
    on Nov 25, 2021
  2. added a commit that references this issue on Jan 18, 2022
  3. self-assigned this
    on May 5, 2022
  4. added a commit that references this issue on Jun 30, 2022
  5. iamahuman commented on Jul 11, 2022

    @iamahuman

    If anyone is suffering from this issue on *nix, compiling the following code as a shared library and putting it into LD_PRELOAD environment variable may work as a stopgap measure:

    #define _GNU_SOURCE
    #include <stddef.h>
    #include <stdint.h>
    #include <dlfcn.h>
    #include <openssl/ssl.h>
    #include <openssl/provider.h>
    
    int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
    {
    	static int once;
    	static int (*orig_OPENSSL_init_ssl)(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
    	if (!__atomic_exchange_n(&once, 1, __ATOMIC_ACQ_REL))
    	{
    		*(void **)&orig_OPENSSL_init_ssl = dlsym(RTLD_NEXT, "OPENSSL_init_ssl");
    		OSSL_PROVIDER_load(NULL, "legacy");
    	}
    	return (*orig_OPENSSL_init_ssl)(opts, settings);
    }
  6. targos commented on Jul 18, 2022

    @targos
    Member

    Fixed in #42972

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

Metadata

Metadata

Assignees

Labels

opensslIssues and PRs related to the OpenSSL dependency.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions