arcgis-python-api icon indicating copy to clipboard operation
arcgis-python-api copied to clipboard

Importing a certificate to Portal with an existing alias always returns True

Open esemplare opened this issue 6 years ago • 1 comments

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 avatar Jun 08 '18 22:06 esemplare

@esemplare we are looking at this issue. Thank you

achapkowski avatar Aug 23 '18 09:08 achapkowski

This issue is older and will be closed in an effort to remove stale issues. Please feel free to reopen if needed.

nanaeaubry avatar Sep 16 '22 05:09 nanaeaubry