1#-----------------------------------------------------------------------------
2# Copyright (c) 2024, PyInstaller Development Team.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6#
7# The full license is in the file COPYING.txt, distributed with this software.
8#
9# SPDX-License-Identifier: Apache-2.0
10#-----------------------------------------------------------------------------
11
12import os
13import sys
14
15# If we collected OpenSSL modules into `ossl-modules` directory, override the OpenSSL search path by setting the
16# `OPENSSL_MODULES` environment variable.
17_ossl_modules_dir = os.path.join(sys._MEIPASS, 'ossl-modules')
18if os.path.isdir(_ossl_modules_dir):
19 os.environ['OPENSSL_MODULES'] = _ossl_modules_dir
20del _ossl_modules_dir