diff -rupN Python-2.7.13/setup.py Python-2.7.13-new/setup.py --- Python-2.7.13/setup.py 2017-01-21 01:46:08.146590046 +0100 +++ Python-2.7.13-new/setup.py 2017-01-21 01:46:08.571585508 +0100 @@ -852,10 +852,13 @@ class PyBuildExt(build_ext): if (ssl_incs is not None and ssl_libs is not None): + _ssl_libs = ['ssl', 'crypto'] + if host_platform.startswith(('mingw', 'win')): + _ssl_libs += ['ws2_32'] exts.append( Extension('_ssl', ['_ssl.c'], include_dirs = ssl_incs, library_dirs = ssl_libs, - libraries = ['ssl', 'crypto'], + libraries = _ssl_libs, depends = ['socketmodule.h']), ) else: missing.append('_ssl')