on-internet
← Community

com.amazonaws.AmazonClientException: Unable to execute HTTP request: peer not authenticated

Stack Overflow ·

I created a new account on amazon aws to use s3 bucket and I've written this code to upload one image file to s3 bucket but it gives me this exception: >Unable to execute HTTP request: peer not authenticated. This is my main method: public class Main2 { public static void main(String[] args) throws IOException { File file=new File("C:\\Users\\KDSss\\OneDrive\\Pictures\\my photo 001.jpg"); try { InputStream targetStream = new FileInputStream(file); S3Upload.uploadImage(targetStream, "Discussion", "jpg"); } catch (FileNotFoundException e) { e.printStackTrace(); } } } And this is my S3Upload.java

Comments

Sign in or sign up to comment and upvote.

No comments yet.