Thanks for posting that code.  This is exactly what we needed to see.  The problem is that you are specifying SSE (with server-managed key) in the init request, but specifying SSE-C (customer-managed key) in the part uploads.  If you want to use SSE-C (where you manage your own keys), you need to change your init call to the following:  // DELETE THIS LINE //objectMetadata.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION);  // Initiate the multipart upload. InitiateMultipartUploadRequest initRequest = new InitiateMultipartUploadRequest(bucketName, keyName,         objectMetadata); initRequest.setSSECustomerKey(SSE_KEY); // ADD THIS LINE InitiateMultipartUploadResult initResponse = S3_CLIENT.initiateMultipartUpload(initRequest);  If you want to use SSE (with server-managed keys), then remove the customer managed key assignment in the part uploads (it will inherit the setting from the init request).
I am getting Caused by: java.net.SocketException: Connection reset by peer: socket write error  when using multi-part upload with SSECustomerKey using Amazon s3 client sdk                  // Create the request to upload a part.                 UploadPartRequest uploadRequest = new UploadPartRequest()//.withSSECustomerKey(SSE_KEY)                         .withBucketName(bucketName)                         .withKey(keyName)                         .withUploadId(initResponse.getUploadId())                         .withPartNumber(i)                         .withInputStream(is)                         .withPartSize(partSize)                         .withSSECustomerKey(SSE_KEY);                  UploadPartResult uploadResult = S3_CLIENT.uploadPart(uploadRequest);  while upload works fine with single part upload  PutObjectRequest putRequest = new PutObjectRequest(bucketName, keyName, is, metadata).withSSECustomerKey(SSE_KEY);   S3_CLIENT.putObject(putRequest);  why is dell emc ecs throwing java.net.SocketException: Connection reset by peer: socket write error
getting Caused by: java.net.SocketException: Connection reset by peer: socket 
write error