Skip to content

Match OpenSSL DLLS names on Windows, build using MASM - #1431

Open
jjhelmus wants to merge 4 commits into
mainfrom
jjh/win_openssl_config
Open

jjhelmus wants to merge 4 commits into
mainfrom
jjh/win_openssl_config

Conversation

@jjhelmus

@jjhelmus jjhelmus commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Build OpenSSL with VC-WIN64A-masm on x64 and no-asm on x86. This matches the build parameters used by Python.org.
On x64 this produce libcrypto-3.dll and libssl-3.dll rather than suffixed versions which were produced before this change. This follows the pattern of upstream and allows these DLLs to be used by downstream packages.

Add tests to validate the DLL names.
Remove nasm as it is no longer used, MASM is now used as an assembler and is provided by the Visual Studio install.

closes #596

Build OpenSSL with VC-WIN64A-masm on x64 to produce libcrypto-3.dll
and libssl-3.dll. Add a test to validate the DLL names.

Closes #596
Pass no-asm to OpenSSL's VC-WIN32 target. This how Python.org builds
OpenSSL for the 32-bit release. Expand the test and correct the library
names for ARM64.
NASM is not longer used when building OpenSSL on Windows. Remove the
package from the build, download metadata and update script.
@jjhelmus jjhelmus added platform:windows Specific to the Windows platform python:3.11 python:3.14 python:3.15 arch:all Select all architectures build:all labels Nov 5, 2026
Comment thread cpython-windows/build.py
LIBFFI_PROPS_REMOVE_RULES = b"""
<Target Name="_CopyLIBFFIDLL" Inputs="@(_LIBFFIDLL)" Outputs="@(_LIBFFIDLL->'$(OutDir)%(Filename)%(Extension)')" AfterTargets="Build">
<Copy SourceFiles="@(_LIBFFIDLL)" DestinationFolder="$(OutDir)" />
</Target>

@jjhelmus jjhelmus Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These constants are not directly related to building OpenSSL but are unused. Removing them as part of this PR since nearby code was modified.

@jjhelmus

jjhelmus commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

OpenSSL describes the MASM target as 'experimental' and recommends nasm.
Despite this, upstream CPython uses this target for OpenSSL builds.

Following upstream CPython's choice to use MASM seems better here to ensure compatibility.

@jjhelmus

jjhelmus commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Note that switching to MASM from nasm is not required to match the OpenSSL DLLs names. OpenSSL can be modified to not produce suffixed DLLs using the VC-WIN64A target.

This branch has not been deployed

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

Labels

arch:all Select all architectures build:all platform:windows Specific to the Windows platform python:3.11 python:3.14 python:3.15

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: OpenSSL installed DLL name differs from CPython, affecting extension modules

1 participant