arcgis-python-api
arcgis-python-api copied to clipboard
Importing a certificate to Portal with an existing alias always returns True
Looking at arcgis/gis/admin/_security.py SSLCertificates.import_server_certificate always returns True, even on exception.
**Note, the Portal Admin API returns a 200 HTTP OK, with an html page specifying an Error and code 500. Understandably this is outside the python api.
To recreate the problem attempt to upload a server certificate with an existing alias. The call returns True with a message "Unable to import certificate".
Sample code:
from arcgis.gis import GIS
from arcgis.gis.admin import PortalAdminManager
gis = GIS(**gis_connection)
portal_mgr = PortalAdminManager(portal_admin_url, gis)
ssl_mgr = portal_mgr.security.ssl
# Run once
ssl_mgr.import_server_certificate(host, cert_pass, cert_file)
# Run again, still returns true, even on exception
ssl_mgr.import_server_certificate(host, cert_pass, cert_file)
Versions: ArcGIS Version: 10.5.1 ArcGIS Python Api version 1.4.1
@esemplare we are looking at this issue. Thank you
This issue is older and will be closed in an effort to remove stale issues. Please feel free to reopen if needed.