summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/cephadm/ssl_cert_utils.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-23 16:45:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-23 16:45:13 +0000
commit389020e14594e4894e28d1eb9103c210b142509e (patch)
tree2ba734cdd7a243f46dda7c3d0cc88c2293d9699f /src/pybind/mgr/cephadm/ssl_cert_utils.py
parentAdding upstream version 18.2.2. (diff)
downloadceph-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 '')
-rw-r--r--src/pybind/mgr/cephadm/ssl_cert_utils.py9
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())