PowerFlex REST API Call Fails Retrieving MDM Certificates
Summary: When attempting to retrieve MDM certificates, using a REST API call from the PowerFlex Gateway, the operation fails.
Symptoms
Powerflex Gateway showing that the MDM certificates are already added to the truststore:
[root@gw /]# /usr/bin/keytool -list -keystore /opt/emc/scaleio/gateway/webapps/ROOT/WEB-INF/classes/certificates/truststore.jks -storepass changeit|grep -i mdm ou=asd, o=emc, c=us, st=massachusetts, l=hopkinton, cn=scaleio-14.14.14.101, givenname=mdm, Nov 7, 2023, trustedCertEntry, ou=asd, o=emc, c=us, st=massachusetts, l=hopkinton, cn=scaleio-14.14.14.102, givenname=mdm, Nov 7, 2023, trustedCertEntry,
The REST API call to retrieve the MDM certificates shows the error:
[root@gw /]# mdm_ip=14.14.14.101; curl -k -u admin:$token https://$gw_ip/api/getHostCertificate/Mdm?host=$mdm_ip
{"message":"Failed retrieving host 14.14.14.101 certificate","httpStatusCode":500,"errorCode":0}[root@gw /]#
Logs from the scaleio.log file may show the following error:
2023-11-07 22:05:43,739 [https-jsse-nio-443-exec-3] ERROR c.e.s.s.w.c.SpecialImplController - Got an exception in handleException com.emc.s3g.scaleio.common.gateway.ScaleIOException: Failed retrieving host 14.14.14.101 certificate
Note that the same REST API call for the LIA component may return the same error.
Impact
Unable to retrieve the MDM or LIA certificate using a REST API call.
Cause
In PowerFlex Gateway version 3.6.1 and below, the Gateway provided the MDM certificate using a dummy truststore. In the PowerFlex Gateway version 3.6.2, the code was changed as part of the new cryptoj library version. Therefore a valid truststore is used.
In this scenario, the user attempted to retrieve and add the MDM certificate using a REST API call, but the MDM certificate was already added in the truststore.
The code is designed to retrieve the MDM certificate if it is not in the PowerFlex Gateway, as it is not a trusted certificate before adding it to the truststore.
Resolution
The REST API call can retrieve the MDM/LIA certificate if the certificate has not already been added to the truststore.
Verify that the MDM certificate that is being retrieved is not already added to the truststore. In this example, the MDM with IP "14.14.14.102" is not added to the truststore.
[root@gw /# /usr/bin/keytool -list -keystore /opt/emc/scaleio/gateway/webapps/ROOT/WEB-INF/classes/certificates/truststore.jks -storepass changeit|grep -i mdm ou=asd, o=emc, c=us, st=massachusetts, l=hopkinton, cn=scaleio-14.14.14.101, givenname=mdm, Nov 7, 2023, trustedCertEntry,
Performing the REST API call to retrieve the MDM certificate is successful.
[root@gw /]# gw_ip=14.14.14.100; mdm_pass='Scaleio123!';token=`curl -k -u admin:$mdm_pass https://$gw_ip/api/login| sed 's/\"//g'` [root@gw /]# mdm_ip=14.14.14.102; curl -k -u admin:$token https://$gw_ip/api/getHostCertificate/Mdm?host=$mdm_ip -----BEGIN CERTIFICATE----- MIIDZDCCAkwCAQEwDQYJKoZIhvcNAQELBQAweDEMMAoGA1UEKgwDTURNMRMwEQYDVQQDDApuZXN0ZWRzdm0yMRIwEAYDVQQHDAlIb3BraW50b24xFjAUBgNVBAgMDU1hc3NhY2h1c2V0dHMxCzAJBgNVBAYTAlVTMQwwCgYDVQQKDANFTUMxDDAKBgNVBAsMA0FTRDAeFw0yMzAzMTQxNDA5MDFaFw0zMzAzMTIxNfe74hjFaMHgxDDAKBgNVBCoMA01ETTETMBEGA1UEAwwKbmVzdGVkc3ZtMjESMBAGA1UEBwwJSG9wa2ludG9uMRYwFAYDVQQIDA1NYXNzYWNodXNldHRzMQswCQYDVQQGEwJVUzEMMAoGA1UECgwDRU1DMQwwCgYDVQQLDANBU0QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCfLI5AFL9EDmd7cBO0Vpe0tuGQa4iHDGIGik8tjCtZKvA9dNh1J5AlVrond1IUOxSezZYz19nDD4wPFrFE99/8zs9OXoisMgw7snNM0orKxbr3uxeQAdO37HVZL0Z4lbKHR3hCRAIEC4F6XZ1rid5gjpKQgePwCM2PWmOsefg68EDCpTWXoYzXgY0OVExbvC56CUTgIZGp92RCcXlZX5/x5pVfMXHYnlKm+wyUkQvl2Lg7GNjjqMGS8K8yaXQKzFpBjsnj58dxcThGCVxzntWit9/q35H0joa8Hw/YORN6gIUNzj79RFk1wopqa02zYRu8ooJJOOjNmGRahFVy7iyPAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAHGhJiiHG7UlEAGk4k0QUKxIvUF0Agi/ho4ScnyWZlpu0YYrJpwrv4+RuZA5JgF6J13b8eOZMDlEvgOv5ljwsep4F8NgoUOUY7S3mu508HuPeNn5jw6vjYGclfbJSfttJ3/uAuTDt4+Fpor4SBuqEELegRaeABsT3ucuyhjyUKQoFR0krQQ77sVyI18PO5A7xb+RfaLViyiHbBSLZDyrhR9xePEoj/8IPJKFFqWIJGQRRPN6ynKa9vZT1P16HSuIt/2mlOsqEvTHbnPsJ9C1IUoI11ZApZI4vVwRAbLUTQjdNlcv/zekC0SfaJls/w9IgMdWiqMV42QOA0L7xEcoNc8= -----END CERTIFICATE-----[root@gw /]#
Additional Information
Impacted Versions
PowerFlex 3.6.2
Fixed In Version
N/A - Working As Designed