I am trying to use quickfix-ssl which exposes the SSLSocketInitiator/Acceptor capabilities currently unsupported in quickfix. Unfortunately there are no pre-compiled .whls for windows os so having to compile from source. I've had to modify "setup.py" as the current config was linux-oriented.
After solving several compiler link errors, I have managed to compile and install the resulting .whl. However, when I attempt to run the application, specifically, SSLSocketAcceptor() I get the error "OPENSSL_Uplink(00007FFAC47C2AC8,08): no OPENSSL_Applink".
In an attempt to solve the issue I followed this solution and added to the "UtilitySSL.cpp" source file and rebuilt but the issue persists, so now I am completely at a loss. Any help would be very much appreciated.
Python Version: 3.7 SSL Version: 1.1.1g OpenSSL Version (from VCPKG): 3.1.4.
"setup.py" code:
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
import glob
import sys
import sysconfig
_VCPKG_ROOT = r"C:\src\vcpkg\vcpkg\installed\x64-windows"
_VCPKG_ROOT_POSIX = "/src/vcpkg/vcpkg/installed/x64-windows"
_WIN_SDK_ROOT = r"C:\Program Files (x86)\Windows Kits\10"
VCPKG_INCLUDE = _VCPKG_ROOT + r'\include'
VCPKG_EXTRA_LIBS = [
_VCPKG_ROOT + r"\lib\libssl.lib",
_VCPKG_ROOT + r"\lib\libcrypto.lib",
#_VCPKG_ROOT + r"\lib\Ws2_32.lib",
]
WIN_EXTRA_LIBS = [
_WIN_SDK_ROOT + r"\Lib\10.0.17763.0\um\x64\WS2_32.lib"
]
VCPKG_DLL_DEPENDENCIES = [
_VCPKG_ROOT + r"\bin\libcrypto-3-x64.dll",
_VCPKG_ROOT + r"\bin\libssl-3-x64.dll",
]
#OPEN_SSL_DLL_DEPS = [
# r"C:\src\openssl-1.1.1w-win64\libcrypto-1_1-x64.dll",
# r"C:\src\openssl-1.1.1w-win64\libssl-1_1-x64.dll",
#]
#r"C:\src\vcpkg\vcpkg\installed\x64-windows\include"
#r"C:\src\vcpkg\vcpkg\installed\x64-windows\lib\libssl.lib",
#r"C:\src\vcpkg\vcpkg\installed\x64-windows\lib\libcrypto.lib",
#r"C:\src\vcpkg\vcpkg\installed\x64-windows\lib\Ws2_32.lib"
class build_ext_subclass(build_ext):
def build_extensions(self):
self.compiler.define_macro("PYTHON_MAJOR_VERSION", sys.version_info[0])
print("Testing for std::tr1::shared_ptr...")
try:
self.compiler.compile(['test_std_tr1_shared_ptr.cpp'])
self.compiler.define_macro("HAVE_STD_TR1_SHARED_PTR")
print("...found")
except:
print(" ...not found")
print("Testing for std::shared_ptr...")
try:
self.compiler.compile(['test_std_shared_ptr.cpp'], extra_preargs=['/std:c++14']),
self.compiler.define_macro("HAVE_STD_SHARED_PTR")
print("...found")
except:
print("...not found")
print("Testing for std::unique_ptr...")
try:
self.compiler.compile(['test_std_unique_ptr.cpp'], extra_preargs=['/std:c++14']),
self.compiler.define_macro("HAVE_STD_UNIQUE_PTR")
print("...found")
except:
print("...not found")
build_ext.build_extensions(self)
# Remove the "-Wstrict-prototypes" compiler option, which isn't valid for C++.
cfg_vars = sysconfig.get_config_vars()
for key, value in cfg_vars.items():
if type(value) == str:
cfg_vars[key] = value.replace("-Wstrict-prototypes", "")
# DDLs to be moved to "Lib/site-packages" in your current environment
dll_files = [('Lib/site-packages', [filepath]) for filepath in VCPKG_DLL_DEPENDENCIES]
#dll_files = [('Lib/site-packages', [filepath]) for filepath in OPEN_SSL_DLL_DEPS]
ext = Extension(
'_quickfix',
glob.glob('C++/*.cpp'),
include_dirs=["C++", VCPKG_INCLUDE],
#define_macros=[("HAVE_SSL", "1"), ("_MSC_VER", 1936)],
#define_macros=[("HAVE_SSL", "1")],
define_macros=[("HAVE_SSL", "1"), ("__cplusplus", "1")],
extra_compile_args=[
'/std:c++14',
#'-W-deprecated',
#'-W-unused-variable',
#'-W-deprecated-declarations',
#'-W-maybe-uninitialized'
],
#extra_link_args=[
# "-lssl"
#],
extra_objects=VCPKG_EXTRA_LIBS + WIN_EXTRA_LIBS
)
with open("README.md") as f:
long_desc=f.read()
setup(name='quickfix-ssl',
version='1.15.1-4',
py_modules=[
'quickfix', 'quickfixt11', 'quickfix40', 'quickfix41', 'quickfix42',
'quickfix43', 'quickfix44', 'quickfix50', 'quickfix50sp1', 'quickfix50sp2'
],
data_files=[('share/quickfix', glob.glob('spec/FIX*.xml'))] + dll_files,
author='Oren Miller',
author_email='[email protected]',
maintainer='Mark Lee',
maintainer_email='[email protected]',
description="FIX (Financial Information eXchange) protocol implementation (SSL enabled)",
long_description=long_desc,
long_description_content_type='text/markdown',
url='http://www.quickfixengine.org',
download_url='http://www.quickfixengine.org',
license_files=('LICENSE',),
cmdclass = {
'build_ext': build_ext_subclass
},
ext_modules=[ext]
)