<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi, I have experience with python but absolutely none with c/c++ so any help would be greatly appreciated! </div><div dir="ltr"><br></div><div dir="ltr">I am running python 3.9.1 for windows 10 (x64). I have noticed the openssl dll files shipped with python (libcrypto-1_1.dll & libssl-1_1.dll) are only version 1.1.7. I would therefore like to replace these with the latest versions.</div><div dir="ltr"><br></div><div dir="ltr">I have been able to successfully build openssl 1.1.9 in windows 10 following the instructions in the release. I am using Microsoft visual studio 2019 + strawberry perl + nasm. I ran the following config command using the x64 native tools command prompt for vs 2019:</div><div dir="ltr"><br></div><div dir="ltr">perl Configure VC-WIN64A</div><div dir="ltr"><br></div><div dir="ltr">I then run the nmake command. This produces the two dlls I need: libcrypto-1_1-x64.dll and libssl-1_1-x64.dll</div><div dir="ltr"><br></div><div dir="ltr">I renamed both files to remove the "-x64" at the end of the name and then used them to replace the existing old dlls in the python installation. </div><div dir="ltr"><br></div><div dir="ltr">When I try to import the ssl library in python, I get the error: </div><div dir="ltr"><br></div><div dir="ltr">ImportError: DLL load failed while importing _ssl: The specified module could not be found.</div><div dir="ltr"><br></div><div dir="ltr">I then built openssl for x86, using the x86 native tools command prompt for vs 2019 and the command:</div><div dir="ltr"><br></div><div dir="ltr">perl Configure VC-WIN32<br></div><div dir="ltr"><br></div><div>I then ran nmake which produced: libcrypto-1_1.dll and libssl-1_1.dll</div><div><br></div><div>I replaced the dlls in the python installation with those. When I try and import the ssl library in python I get: ImportError: DLL load failed while importing _ssl: %1 is not a valid Win32 application.</div><div dir="ltr"><div><br></div><div>I am reasonably certain I need the x64 version of the dlls because  (1) my python installation is x64 (2) when I used the visual studio dumpbin.exe tool on the python shipped dlls to inspect the headers they say "x64" in them (3) the x64 dlls  are a similar size to the ones shipped with python and the x86 versions are smaller. </div><div><br></div><div>I don't know what I am doing wrong and am out of ideas. I was once able to do this following the above steps for an older version of python. That version shipped with openssl 1.1.3 and I built the dlls for 1.1.7 and replaced them and python had no issues. If I recall correctly the perl configuration commands did not use "VC-WIN32" "VC-WIN64A" but instead used something different like "x86_x64" and "x64_x86". Is it possible that the default configuration scripts have changed over these versions such that the default windows x64 configuration no longer builds openssl in a way that works with python and I therefore need to use custom settings?</div><div><br></div><div>Its quite important for me that I do this as I have a small python based desktop client app in production and I want to make sure the clients are always running the latest version of openssl. Thanks for any help!</div><div><br></div><div>Below is the output of "perl <a href="http://configdata.pm">configdata.pm</a> --dump":</div><div><br></div><div><div>Command line (with current working directory = .):</div><div><br></div><div>    C:\Strawberry\perl\bin\perl.exe Configure VC-WIN64A</div><div><br></div><div>Perl information:</div><div><br></div><div>    C:\Strawberry\perl\bin\perl.exe</div><div>    5.32.1 for MSWin32-x64-multi-thread</div><div><br></div><div>Enabled features:</div><div><br></div><div>    aria</div><div>    asm</div><div>    async</div><div>    autoalginit</div><div>    autoerrinit</div><div>    autoload-config</div><div>    bf</div><div>    blake2</div><div>    buildtest-c\+\+</div><div>    camellia</div><div>    capieng</div><div>    cast</div><div>    chacha</div><div>    cmac</div><div>    cms</div><div>    comp</div><div>    ct</div><div>    deprecated</div><div>    des</div><div>    dgram</div><div>    dh</div><div>    dsa</div><div>    dso</div><div>    dtls</div><div>    dynamic-engine</div><div>    ec</div><div>    ec2m</div><div>    ecdh</div><div>    ecdsa</div><div>    engine</div><div>    err</div><div>    filenames</div><div>    gost</div><div>    hw(-.+)?</div><div>    idea</div><div>    makedepend</div><div>    md4</div><div>    mdc2</div><div>    multiblock</div><div>    nextprotoneg</div><div>    pinshared</div><div>    ocb</div><div>    ocsp</div><div>    pic</div><div>    poly1305</div><div>    posix-io</div><div>    psk</div><div>    rc2</div><div>    rc4</div><div>    rdrand</div><div>    rfc3779</div><div>    rmd160</div><div>    scrypt</div><div>    seed</div><div>    shared</div><div>    siphash</div><div>    sm2</div><div>    sm3</div><div>    sm4</div><div>    sock</div><div>    srp</div><div>    srtp</div><div>    sse2</div><div>    ssl</div><div>    static-engine</div><div>    stdio</div><div>    tests</div><div>    threads</div><div>    tls</div><div>    ts</div><div>    ui-console</div><div>    whirlpool</div><div>    tls1</div><div>    tls1-method</div><div>    tls1_1</div><div>    tls1_1-method</div><div>    tls1_2</div><div>    tls1_2-method</div><div>    tls1_3</div><div>    dtls1</div><div>    dtls1-method</div><div>    dtls1_2</div><div>    dtls1_2-method</div><div><br></div><div>Disabled features:</div><div><br></div><div>    afalgeng                [not-linux] OPENSSL_NO_AFALGENG</div><div>    asan                    [default]   OPENSSL_NO_ASAN</div><div>    crypto-mdebug           [default]   OPENSSL_NO_CRYPTO_MDEBUG</div><div>    crypto-mdebug-backtrace [default]   OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE</div><div>    devcryptoeng            [default]   OPENSSL_NO_DEVCRYPTOENG</div><div>    ec_nistp_64_gcc_128     [default]   OPENSSL_NO_EC_NISTP_64_GCC_128</div><div>    egd                     [default]   OPENSSL_NO_EGD</div><div>    external-tests          [default]   OPENSSL_NO_EXTERNAL_TESTS</div><div>    fuzz-libfuzzer          [default]   OPENSSL_NO_FUZZ_LIBFUZZER</div><div>    fuzz-afl                [default]   OPENSSL_NO_FUZZ_AFL</div><div>    heartbeats              [default]   OPENSSL_NO_HEARTBEATS</div><div>    md2                     [default]   OPENSSL_NO_MD2 (skip crypto\md2)</div><div>    msan                    [default]   OPENSSL_NO_MSAN</div><div>    rc5                     [default]   OPENSSL_NO_RC5 (skip crypto\rc5)</div><div>    sctp                    [default]   OPENSSL_NO_SCTP</div><div>    ssl-trace               [default]   OPENSSL_NO_SSL_TRACE</div><div>    ubsan                   [default]   OPENSSL_NO_UBSAN</div><div>    unit-test               [default]   OPENSSL_NO_UNIT_TEST</div><div>    weak-ssl-ciphers        [default]   OPENSSL_NO_WEAK_SSL_CIPHERS</div><div>    zlib                    [default]</div><div>    zlib-dynamic            [default]</div><div>    ssl3                    [default]   OPENSSL_NO_SSL3</div><div>    ssl3-method             [default]   OPENSSL_NO_SSL3_METHOD</div><div><br></div><div>Config target attributes:</div><div><br></div><div>    AR => "lib",</div><div>    ARFLAGS => "/nologo",</div><div>    AS => "nasm",</div><div>    ASFLAGS => "-g",</div><div>    CC => "cl",</div><div>    CFLAGS => "/W3 /wd4090 /nologo /O2",</div><div>    CPP => "\$(CC) /EP /C",</div><div>    HASHBANGPERL => "/usr/bin/env perl",</div><div>    LD => "link",</div><div>    LDFLAGS => "/nologo /debug",</div><div>    MT => "mt",</div><div>    MTFLAGS => "-nologo",</div><div>    RANLIB => "CODE(0x2602f90)",</div><div>    RC => "rc",</div><div>    aes_asm_src => "aes_core.c aes_cbc.c vpaes-x86_64.s aesni-x86_64.s aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s",</div><div>    aes_obj => "aes_core.o aes_cbc.o vpaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o aesni-sha256-x86_64.o aesni-mb-x86_64.o",</div><div>    apps_aux_src => "win32_init.c",</div><div>    apps_init_src => "../ms/applink.c",</div><div>    apps_obj => "win32_init.o",</div><div>    aroutflag => "/out:",</div><div>    asflags => "-Ox -f win64 -DNEAR",</div><div>    asoutflag => "-o ",</div><div>    bf_asm_src => "bf_enc.c",</div><div>    bf_obj => "bf_enc.o",</div><div>    bin_cflags => "/Zi /Fdapp.pdb",</div><div>    bin_lflags => "/subsystem:console /opt:ref",</div><div>    bn_asm_src => "bn_asm.c x86_64-mont.s x86_64-mont5.s x86_64-gf2m.s rsaz_exp.c rsaz-x86_64.s rsaz-avx2.s",</div><div>    bn_obj => "bn_asm.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o rsaz_exp.o rsaz-x86_64.o rsaz-avx2.o",</div><div>    bn_ops => "EXPORT_VAR_AS_FN SIXTY_FOUR_BIT",</div><div>    build_file => "makefile",</div><div>    build_scheme => [ "unified", "windows", "VC-common" ],</div><div>    cast_asm_src => "c_enc.c",</div><div>    cast_obj => "c_enc.o",</div><div>    cflags => "/Gs0 /GF /Gy /MD",</div><div>    chacha_asm_src => "chacha-x86_64.s",</div><div>    chacha_obj => "chacha-x86_64.o",</div><div>    cmll_asm_src => "cmll-x86_64.s cmll_misc.c",</div><div>    cmll_obj => "cmll-x86_64.o cmll_misc.o",</div><div>    coutflag => "/Fo",</div><div>    cppflags => "",</div><div>    cpuid_asm_src => "x86_64cpuid.s",</div><div>    cpuid_obj => "x86_64cpuid.o",</div><div>    defines => [ "OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN", "UNICODE", "_UNICODE", "_CRT_SECURE_NO_DEPRECATE", "_WINSOCK_DEPRECATED_NO_WARNINGS", "OPENSSL_USE_APPLINK" ],</div><div>    des_asm_src => "des_enc.c fcrypt_b.c",</div><div>    des_obj => "des_enc.o fcrypt_b.o",</div><div>    disable => [  ],</div><div>    dso_cflags => "/Zi /Fddso.pdb",</div><div>    dso_extension => ".dll",</div><div>    dso_scheme => "win32",</div><div>    ec_asm_src => "ecp_nistz256.c ecp_nistz256-x86_64.s x25519-x86_64.s",</div><div>    ec_obj => "ecp_nistz256.o ecp_nistz256-x86_64.o x25519-x86_64.o",</div><div>    enable => [  ],</div><div>    ex_libs => "ws2_32.lib gdi32.lib advapi32.lib crypt32.lib user32.lib",</div><div>    exe_extension => "",</div><div>    includes => [  ],</div><div>    keccak1600_asm_src => "keccak1600-x86_64.s",</div><div>    keccak1600_obj => "keccak1600-x86_64.o",</div><div>    ldoutflag => "/out:",</div><div>    lflags => "",</div><div>    lib_cflags => "/Zi /Fdossl_static.pdb",</div><div>    lib_cppflags => "",</div><div>    lib_defines => [ "L_ENDIAN" ],</div><div>    md5_asm_src => "md5-x86_64.s",</div><div>    md5_obj => "md5-x86_64.o",</div><div>    modes_asm_src => "ghash-x86_64.s aesni-gcm-x86_64.s",</div><div>    modes_obj => "ghash-x86_64.o aesni-gcm-x86_64.o",</div><div>    module_cflags => "",</div><div>    module_cxxflags => "",</div><div>    module_ldflags => "/dll",</div><div>    mtinflag => "-manifest ",</div><div>    mtoutflag => "-outputresource:",</div><div>    multilib => "-x64",</div><div>    padlock_asm_src => "e_padlock-x86_64.s",</div><div>    padlock_obj => "e_padlock-x86_64.o",</div><div>    perlasm_scheme => "auto",</div><div>    poly1305_asm_src => "poly1305-x86_64.s",</div><div>    poly1305_obj => "poly1305-x86_64.o",</div><div>    rc4_asm_src => "rc4-x86_64.s rc4-md5-x86_64.s",</div><div>    rc4_obj => "rc4-x86_64.o rc4-md5-x86_64.o",</div><div>    rc5_asm_src => "rc5_enc.c",</div><div>    rc5_obj => "rc5_enc.o",</div><div>    rcoutflag => "/fo",</div><div>    rmd160_asm_src => "",</div><div>    rmd160_obj => "",</div><div>    sha1_asm_src => "sha1-x86_64.s sha256-x86_64.s sha512-x86_64.s sha1-mb-x86_64.s sha256-mb-x86_64.s",</div><div>    sha1_obj => "sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o sha1-mb-x86_64.o sha256-mb-x86_64.o",</div><div>    shared_cflag => "",</div><div>    shared_defines => [  ],</div><div>    shared_extension => ".dll",</div><div>    shared_extension_simple => ".dll",</div><div>    shared_ldflag => "/dll",</div><div>    shared_rcflag => "",</div><div>    shared_target => "win-shared",</div><div>    sys_id => "WIN64A",</div><div>    thread_defines => [  ],</div><div>    thread_scheme => "winthreads",</div><div>    unistd => "<unistd.h>",</div><div>    uplink_aux_src => "../ms/uplink.c uplink-x86_64.s",</div><div>    uplink_obj => "../ms/uplink.o uplink-x86_64.o",</div><div>    wp_asm_src => "wp-x86_64.s",</div><div>    wp_obj => "wp-x86_64.o",</div><div><br></div><div>Recorded environment:</div><div><br></div><div>    AR =</div><div>    ARFLAGS =</div><div>    AS =</div><div>    ASFLAGS =</div><div>    BUILDFILE =</div><div>    CC =</div><div>    CFLAGS =</div><div>    CPP =</div><div>    CPPDEFINES =</div><div>    CPPFLAGS =</div><div>    CPPINCLUDES =</div><div>    CROSS_COMPILE =</div><div>    CXX =</div><div>    CXXFLAGS =</div><div>    HASHBANGPERL =</div><div>    LD =</div><div>    LDFLAGS =</div><div>    LDLIBS =</div><div>    MT =</div><div>    MTFLAGS =</div><div>    OPENSSL_LOCAL_CONFIG_DIR =</div><div>    PERL =</div><div>    RANLIB =</div><div>    RC =</div><div>    RCFLAGS =</div><div>    RM =</div><div>    WINDRES =</div><div>    __CNF_CFLAGS =</div><div>    __CNF_CPPDEFINES =</div><div>    __CNF_CPPFLAGS =</div><div>    __CNF_CPPINCLUDES =</div><div>    __CNF_CXXFLAGS =</div><div>    __CNF_LDFLAGS =</div><div>    __CNF_LDLIBS =</div><div><br></div><div>Makevars:</div><div><br></div><div>    AR              = lib</div><div>    ARFLAGS         = /nologo</div><div>    AS              = nasm</div><div>    ASFLAGS         = -g</div><div>    CC              = cl</div><div>    CFLAGS          = /W3 /wd4090 /nologo /O2</div><div>    CPP             = $(CC) /EP /C</div><div>    CPPDEFINES      =</div><div>    CPPFLAGS        =</div><div>    CPPINCLUDES     =</div><div>    CXXFLAGS        =</div><div>    HASHBANGPERL    = /usr/bin/env perl</div><div>    LD              = link</div><div>    LDFLAGS         = /nologo /debug</div><div>    LDLIBS          =</div><div>    MT              = mt</div><div>    MTFLAGS         = -nologo</div><div>    PERL            = C:\Strawberry\perl\bin\perl.exe</div><div>    RANLIB          = ranlib</div><div>    RC              = rc</div><div>    RCFLAGS         =</div><div><br></div><div>NOTE: These variables only represent the configuration view.  The build file</div><div>template may have processed these variables further, please have a look at the</div><div>build file for more exact data:</div><div>    makefile</div><div><br></div><div>build file:</div><div><br></div><div>    makefile</div><div><br></div><div>build file templates:</div><div><br></div><div>    Configurations\common0.tmpl</div><div>    Configurations\windows-makefile.tmpl</div><div>    Configurations\common.tmpl</div></div><div><br></div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div>