Closed jorn86 closed 6 years ago
Hi, this could be due to the OpenJDK 9 installation not containing the root Amazon Trust Services certificates. Can you check your JDK 9 installation's cacerts to ensure the root CA's listed in this blog post are there? https://aws.amazon.com/blogs/security/how-to-prepare-for-aws-move-to-its-own-certificate-authority/
Also, which services and regions are working okay for you with JDK 9? We can check to see what root CA's they're using to see if this is the issue.
Services: The same SSL error occurs using the SDK for Cloudsearch. The SDK for S3 works without triggering the error.
For testing the certificates, I tried opening a HttpsUrlConnection
to each of the URLs mentioned in the article you linked. Those all open (new URL(url).openConnection();
) just fine:
For https://good.sca0a.amazontrust.com/, success
For https://good.sca1a.amazontrust.com/, success
For https://good.sca2a.amazontrust.com/, success
For https://good.sca3a.amazontrust.com/, success
For https://good.sca4a.amazontrust.com/, success
For https://starfieldtech.com/, success
but when actually trying to read them (new URL(url).openConnection().getInputStream();
) they throw the exception:
For https://good.sca0a.amazontrust.com/, sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
For https://good.sca1a.amazontrust.com/, sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
For https://good.sca2a.amazontrust.com/, sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
For https://good.sca3a.amazontrust.com/, sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
For https://good.sca4a.amazontrust.com/, sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
For https://starfieldtech.com/, sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Hope this helps, and please let me know if you need more information
@jorn86 So just opening the connection doesn't appear to be enough to check that your JVM can successfully validate the cert; I guess it doesn't attempt the handshake until after you try to get the InputStream
.
For example, using one of the expired URLs from https://www.amazontrust.com/repository/ (such as https://expired.sca1a.amazontrust.com/), I can open the connection but I also get a cert error when try to do connection.getInputStream()
. However, it works fine with the the valid certificates.
Assuming you were trying to use CloudSearch in eu-west-1
as well, it looks like they're also using the new Root CA now:
curl -v https://cloudsearch.eu-west-1.amazonaws.com
* Rebuilt URL to: https://cloudsearch.eu-west-1.amazonaws.com/
* Trying 52.95.120.87...
* Connected to cloudsearch.eu-west-1.amazonaws.com (52.95.120.87) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
* Server certificate: cloudsearch.eu-west-1.amazonaws.com
* Server certificate: Amazon
* Server certificate: Amazon Root CA 1
* Server certificate: Starfield Services Root Certificate Authority - G2
At this point, looks like your installation is missing the root CA's. Updating your trust store should fix this issue.
Going to go ahead and close this since it looks like a cert issue and not an issue with the SDK. Feel free to reopen if the problem persists after updating the certs.
I'm using the AWS library to send email through SES. On java 8, it works fine. Other non-SES services also work fine on java 9. But this particular combination triggers an error. Here's the relevant part of the log:
I'm running openjdk 9.0.4 on Ubuntu 17.04.
As a workaround, would it be possible to override the http client used by the library, e.g. from apache to Jersey? I checked, but could only find config options for apache, not a full client implementation override.