Skip to content

Commit be4d48e

Browse files
safianalicbmatthallcb
authored andcommitted
MB-55841 [BP] Set CRYPTOGRAPHY_OPENSSL_NO_LEGACY
Currently, the "import pem" step fails due to a dependency in the cryptography library, which seems to fail on Macs if the above environment variable is not set. This change automatically sets CRYPTOGRAPHY_OPENSSL_NO_LEGACY, allowing the import step to work and couchbase-cli Change-Id: Id64fdc3abb5c9063fcfd948c80b0b76ff77b6d41 Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/200067 Well-Formed: Restriction Checker Reviewed-by: Maksimiljans Januska <maks.januska@couchbase.com> Reviewed-by: Nour Elmenyawi <nour.elmenyawi@couchbase.com> Tested-by: Matt Hall <matt.hall@couchbase.com>
1 parent 51724d3 commit be4d48e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

x509_adapter.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,19 @@
1515
# limitations under the License.
1616

1717
import base64
18+
import os # noqa
1819
import ssl
1920
from pathlib import Path
2021
from typing import Optional, Tuple
2122

2223
import Crypto.IO.PKCS8 as pkcs8
24+
25+
"""This environment variable is needed to prevent the "import pem" step is failing on MacOS.
26+
pem imports OpenSSL, which imports cryptography, which seems to fail as the MacOS version of OpenSSL doesn't seem to
27+
have the legacy algorithms required. Since we don't use any of these algorithms in this file, setting this environment
28+
variable solves the issue without problem.
29+
"""
30+
os.environ["CRYPTOGRAPHY_OPENSSL_NO_LEGACY"] = "true" # noqa
2331
import pem
2432
from cryptography import x509
2533
from cryptography.exceptions import UnsupportedAlgorithm

0 commit comments

Comments
 (0)