Mi red está detrás de ZScaler Proxy. He instalado AWS CLI. He agregado todos los certificados raíz CA de Amazon junto con el certificado raíz ZScaler CA en un archivo pem. Configuré AWS_CA_Bundle y mi comando aws cli para obtener secretsmanager funcionó.
Pero cuando estoy en la misma máquina, estoy tratando de obtener SecretManagers usando AWS SDK, da una excepción: Unable to find valid certification path to requested target .
Alguien me puede orientar que se debe hacer?
A continuación se muestra el código fuente
public class AwsSecretManager { public static AWSSecretManagerPojo getRedshiftCredentialsFromSecretManager(String secretName) throws JsonUtilityException, AwsSecretException { String secret = getSecret(secretName); // Gaurav added this. System.out.println("secret \n" + secret); if (!StringUtility.isNullOrEmpty(secret)) { AWSSecretManagerPojo AWSSecretManagerPojo = GsonUtility.getInstance().fromJson(secret, AWSSecretManagerPojo.class, EdelweissConstant.GSON_TAG); return AWSSecretManagerPojo; } else { throw new AwsSecretException("unable to get redshift credentials from aws secret manager"); } } private static String getSecret(String secretName) { // Gaurav commented below and manually supplied the secret as SSL issue is there. String region = EdelweissConstant.AWS_SECRET_MANAGER_REGION; AWSSecretsManager client = AWSSecretsManagerClientBuilder.standard() .withRegion(region) .build(); String secret = null; GetSecretValueRequest getSecretValueRequest = new GetSecretValueRequest() .withSecretId(secretName); GetSecretValueResult getSecretValueResult = client.getSecretValue(getSecretValueRequest); if (getSecretValueResult.getSecretString() != null) { secret = getSecretValueResult.getSecretString(); } return secret; }Eliminé todos los certificados de Amazon y acabo de agregar ZScaler Root Certiicate. Y resolvió el problema.