diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py index 56d8206612e6..406b1ea990a2 100644 --- a/src/cryptography/hazmat/backends/openssl/backend.py +++ b/src/cryptography/hazmat/backends/openssl/backend.py @@ -99,7 +99,7 @@ def openssl_assert(self, ok: bool) -> None: def _enable_fips(self) -> None: # This function enables FIPS mode for OpenSSL 3.0.0 on installs that # have the FIPS provider installed properly. - self._binding._enable_fips() + rust_openssl.enable_fips(rust_openssl._providers) assert rust_openssl.is_fips_enabled() self._fips_enabled = rust_openssl.is_fips_enabled() diff --git a/src/cryptography/hazmat/bindings/openssl/binding.py b/src/cryptography/hazmat/bindings/openssl/binding.py index 65eb5829134a..f5d8cb0b7d9f 100644 --- a/src/cryptography/hazmat/bindings/openssl/binding.py +++ b/src/cryptography/hazmat/bindings/openssl/binding.py @@ -64,9 +64,6 @@ class Binding: def __init__(self) -> None: self._ensure_ffi_initialized() - def _enable_fips(self) -> None: - openssl.enable_fips(openssl._providers) - @classmethod def _ensure_ffi_initialized(cls) -> None: with cls._init_lock: