Description: Build against the system libcrypto
 By default, aws-crt-python brings its own fork of libcrypto as crt/aws-lc.
 This patch changes the build configuration to use the system-wide OpenSSL
 libcrypto instead.
Author: Noah Meyerhans <noahm@debian.org>
Forwarded: not-needed
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: aws-crt-python/setup.py
===================================================================
--- aws-crt-python.orig/setup.py
+++ aws-crt-python/setup.py
@@ -132,8 +132,6 @@ class AwsLib:
 # They're built along with the extension.
 AWS_LIBS = []
 if sys.platform != 'darwin' and sys.platform != 'win32':
-    # aws-lc produces libcrypto.a
-    AWS_LIBS.append(AwsLib('aws-lc', libname='crypto'))
     AWS_LIBS.append(AwsLib('s2n'))
 AWS_LIBS.append(AwsLib('aws-c-common'))
 AWS_LIBS.append(AwsLib('aws-c-sdkutils'))
@@ -180,6 +178,7 @@ class awscrt_build_ext(setuptools.comman
         cmake_args.extend([
             f'-DCMAKE_INSTALL_PREFIX={install_path}',
             f'-DCMAKE_BUILD_TYPE={build_type}',
+            f'-DUSE_OPENSSL=ON',
         ])
 
         if sys.platform == 'darwin':
@@ -295,15 +294,7 @@ def awscrt_ext():
         extra_link_args += ['-framework', 'Security']
 
     else:  # unix
-        # linker will prefer shared libraries over static if it can find both.
-        # force linker to choose static variant by using using "-l:libcrypto.a" syntax instead of just "-lcrypto".
-        libraries = [':lib{}.a'.format(x) for x in libraries]
-        libraries += ['rt']
-
-        # hide the symbols from libcrypto.a
-        # this prevents weird crashes if an application also ends up using
-        # libcrypto.so from the system's OpenSSL installation.
-        extra_link_args += ['-Wl,--exclude-libs,libcrypto.a']
+        libraries += ['rt', 'crypto']
 
         # python usually adds -pthread automatically, but we've observed
         # rare cases where that didn't happen, so let's be explicit.
Index: aws-crt-python/crt/CMakeLists.txt
===================================================================
--- aws-crt-python.orig/crt/CMakeLists.txt
+++ aws-crt-python/crt/CMakeLists.txt
@@ -28,7 +28,6 @@ if(UNIX AND NOT APPLE)
     set(DISABLE_GO ON) # Build without using Go, we don't want the extra dependency
     set(DISABLE_PERL ON) # Build without using Perl, we don't want the extra dependency
     set(BUILD_LIBSSL OFF) # Don't need libssl, only need libcrypto
-    add_subdirectory(aws-lc)
 
     set(UNSAFE_TREAT_WARNINGS_AS_ERRORS OFF)
     add_subdirectory(s2n)
