Skip to content

Commit

Permalink
Update variable name, there are now many linuxes (#1070)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex authored Dec 23, 2021
1 parent 8b85cfd commit d184fbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/OpenSSL/SSL.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@

# These values are compared to output from cffi's ffi.string so they must be
# byte strings.
_CRYPTOGRAPHY_MANYLINUX1_CA_DIR = b"/opt/pyca/cryptography/openssl/certs"
_CRYPTOGRAPHY_MANYLINUX1_CA_FILE = b"/opt/pyca/cryptography/openssl/cert.pem"
_CRYPTOGRAPHY_MANYLINUX_CA_DIR = b"/opt/pyca/cryptography/openssl/certs"
_CRYPTOGRAPHY_MANYLINUX_CA_FILE = b"/opt/pyca/cryptography/openssl/cert.pem"


class Error(Exception):
Expand Down Expand Up @@ -872,8 +872,8 @@ def set_default_verify_paths(self):
# to the exact values we use in our manylinux1 builds. If they are
# then we know to load the fallbacks
if (
default_dir == _CRYPTOGRAPHY_MANYLINUX1_CA_DIR
and default_file == _CRYPTOGRAPHY_MANYLINUX1_CA_FILE
default_dir == _CRYPTOGRAPHY_MANYLINUX_CA_DIR
and default_file == _CRYPTOGRAPHY_MANYLINUX_CA_FILE
):
# This is manylinux1, let's load our fallback paths
self._fallback_default_verify_paths(
Expand Down
8 changes: 4 additions & 4 deletions tests/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,8 @@ def test_load_verify_locations_wrong_args(self):
def test_fallback_default_verify_paths(self, monkeypatch):
"""
Test that we load certificates successfully on linux from the fallback
path. To do this we set the _CRYPTOGRAPHY_MANYLINUX1_CA_FILE and
_CRYPTOGRAPHY_MANYLINUX1_CA_DIR vars to be equal to whatever the
path. To do this we set the _CRYPTOGRAPHY_MANYLINUX_CA_FILE and
_CRYPTOGRAPHY_MANYLINUX_CA_DIR vars to be equal to whatever the
current OpenSSL default is and we disable
SSL_CTX_SET_default_verify_paths so that it can't find certs unless
it loads via fallback.
Expand All @@ -1226,12 +1226,12 @@ def test_fallback_default_verify_paths(self, monkeypatch):
)
monkeypatch.setattr(
SSL,
"_CRYPTOGRAPHY_MANYLINUX1_CA_FILE",
"_CRYPTOGRAPHY_MANYLINUX_CA_FILE",
_ffi.string(_lib.X509_get_default_cert_file()),
)
monkeypatch.setattr(
SSL,
"_CRYPTOGRAPHY_MANYLINUX1_CA_DIR",
"_CRYPTOGRAPHY_MANYLINUX_CA_DIR",
_ffi.string(_lib.X509_get_default_cert_dir()),
)
context.set_default_verify_paths()
Expand Down

0 comments on commit d184fbb

Please sign in to comment.