0

I am getting:

 "Unable to execute HTTP request: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty" 

When using AWS SDK On Java 1.8, or to be more exact When I execute:

AWSSecretsManager.getSecretValue

Thing is, everything works fine when I shift to Java 15.(I must stick to Java 8) I tried the suggestions from the following post with no success. Any help or lead would be highly appreciated!

PloniStacker
  • 574
  • 4
  • 23

1 Answers1

1

Are you using Secret Manager V1 or V2 Java API.

I just tested the Secret Manager V2 code example here:

https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/javav2/example_code/secretsmanager/src/main/java/com/example/secrets/GetSecretValue.java

and it works perfectly with Java 1.8.

enter image description here

smac2020
  • 9,637
  • 4
  • 24
  • 38
  • Thanks for your answer, I eventually found the solution by overwriting cacert from Java 15 on Java 8. I did try to go your suggested route, however Maven cant find software.amazon.awssdk secretsmanager 2.15.76 I tried different repositories and nothing. – PloniStacker Feb 05 '21 at 20:36
  • Very strange as I have no issue with Java 1.8 and the POMs here: https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2/example_code/secretsmanager – smac2020 Feb 05 '21 at 20:49
  • if you use aws/secretmanager as an Encryption key, you do not need to use TrustStore I think. – Eric Jul 26 '23 at 14:10