]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/dashboard: use cephadm root CA for RGW SSL and improve error handling 67857/head
authoryaelazulay-redhat <yaelazulay@redhat.com>
Mon, 16 Mar 2026 20:37:22 +0000 (22:37 +0200)
committeryaelazulay-redhat <yaelazulay@redhat.com>
Mon, 27 Apr 2026 16:51:23 +0000 (19:51 +0300)
commit7c6ea18d6e0bcaad73d3fb8a2138f4b31894b138
tree790216109114d99a02b98e231075a5ca71763b00
parent5d5d8dc8377a6b34d97e0008892ae835e3ae7131
mgr/dashboard: use cephadm root CA for RGW SSL and improve error handling

Problem: Dashboard fails to access object pages when RGW is deployed with SSL using cephadm-signed certificates.

Root cause: RGW REST API connection fails with SSL certificate verification error because the cephadm root CA certificate that signed the RGW SSL certificates is not in the dashboard's trust store.

Code Fixes:
1. rgw_client.py:
Added _get_ssl_ca_bundle() which fetches the cephadm root CA certificate from the cert store and writes it atomically (via a temp file and os.replace) to a fixed path (/tmp/ceph-dashboard-ca/rgw-cephadm-root-ca.pem), returning the file path for SSL verification.
Notes:
- The file is written once per mgr process lifetime and reused by all RgwClient instances. On mgr restart it is refetched and overwritten.
- A dedicated subdirectory (/tmp/ceph-dashboard-ca/) is used because /tmp has the sticky bit set, which prevents os.replace from overwriting files owned by a different user.

2. rest_client.py
Fixed secondary that handle_connection_error crash - when the initial SSL error occurred, the error handler itself crashed trying to process the exception, because it assumed reason.args[0] was always a string, but for SSL errors it's an SSLError object.

Fixes: https://tracker.ceph.com/issues/74393
Signed-off-by: Yael Azulay <yazulay@redhat.com>
src/pybind/mgr/dashboard/rest_client.py
src/pybind/mgr/dashboard/services/rgw_client.py