diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-23 16:45:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-23 16:45:13 +0000 |
commit | 389020e14594e4894e28d1eb9103c210b142509e (patch) | |
tree | 2ba734cdd7a243f46dda7c3d0cc88c2293d9699f /src/pybind/mgr/cephadm/ssl_cert_utils.py | |
parent | Adding upstream version 18.2.2. (diff) | |
download | ceph-389020e14594e4894e28d1eb9103c210b142509e.tar.xz ceph-389020e14594e4894e28d1eb9103c210b142509e.zip |
Adding upstream version 18.2.3.upstream/18.2.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/pybind/mgr/cephadm/ssl_cert_utils.py')
-rw-r--r-- | src/pybind/mgr/cephadm/ssl_cert_utils.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/pybind/mgr/cephadm/ssl_cert_utils.py b/src/pybind/mgr/cephadm/ssl_cert_utils.py index fcc6f00ea..6295152c7 100644 --- a/src/pybind/mgr/cephadm/ssl_cert_utils.py +++ b/src/pybind/mgr/cephadm/ssl_cert_utils.py @@ -46,7 +46,7 @@ class SSLCerts: root_builder = root_builder.public_key(root_public_key) root_builder = root_builder.add_extension( x509.SubjectAlternativeName( - [x509.IPAddress(ipaddress.IPv4Address(addr))] + [x509.IPAddress(ipaddress.ip_address(addr))] ), critical=False ) @@ -70,12 +70,9 @@ class SSLCerts: def generate_cert(self, host: str, addr: str) -> Tuple[str, str]: have_ip = True try: - ip = x509.IPAddress(ipaddress.IPv4Address(addr)) + ip = x509.IPAddress(ipaddress.ip_address(addr)) except Exception: - try: - ip = x509.IPAddress(ipaddress.IPv6Address(addr)) - except Exception: - have_ip = False + have_ip = False private_key = rsa.generate_private_key( public_exponent=65537, key_size=4096, backend=default_backend()) |