Can't use Amazon S3 API over SSL?

后端 未结 2 1212
灰色年华
灰色年华 2021-01-12 00:30

I\'m trying to use Amazon S3 API to encrypt and upload a file.

public class AmazonS3 {

    String KmsId = \"my_id_comes_here\";

    private TransferManager         


        
2条回答
  •  日久生厌
    2021-01-12 01:20

    Your trust store doesn't have the certificate authority that secures the AWS APIs. You need to create a new trust store that combines client.ts with the ones required for AWS. The easiest way to do this is to merge client.ts with the cacerts keystore from the JRE.

    Example:

    keytool -importkeystore -srckeystore client.ts -destkeystore combined.ts -srcstorepass changeit -deststorepass changeit
    keytool -importkeystore -srckeystore $JAVA_HOME/jre/lib/security/cacerts -destkeystore combined.ts -srcstorepass changeit -deststorepass changeit
    

    Then use combined.ts instead of client.ts.

提交回复
热议问题