-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to customize httpClientBuilder for s3 client (#50)
# Pull Request ## What Add a new parameter S3_SDK_HTTP_CLIENT_BUILDER_CONFIG This is a class to customize the httpClient used by the s3 client ## Why Our use case is: We have a minio server with https endpoint. And the minio server uses self-signed certificate to do the TLS. When our kafka client uses this lib to put object to that minio, we need to make sure the CA certificate of the minio server should in the truststore used by the s3 client. This is the reason we want to customize the httpClient. Another limitation is that we need add the CA certificate to the truststore in the code instead of using the keytool command line. Since the command line is hard to automate in our use case. So finally I choose add this support in the this lib. ## How 1) Add the S3_SDK_HTTP_CLIENT_BUILDER_CONFIG class parameter 2) Add method getAmazonSdkHttpClientBuilderInstance() to get the object of SdkHttpClient.Builder by reflection 3) Add some logic in the createAmazonS3Client() method to config the SdkHttpClient.Builder ## Test I added this parameter with DefaultTlsTrustManagersProvider in the UT and it works fine. --------- Co-authored-by: Philipp Schirmer <[email protected]>
- Loading branch information
1 parent
b5d370c
commit 379eed2
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters