title: Amazon S3 client connect through proxy - putObject getting NullPointerException
body: <p>I've got this simple piece of code which is trying to upload a file to Amazon S3 via a proxy. This is the code:</p>
  
  <pre><code>    BasicAWSCredentials basicCred = new BasicAWSCredentials("my_access_key", "my_secret_key");
      ClientConfiguration clientCfg = new ClientConfiguration();
      clientCfg.setProtocol(Protocol.HTTP);
  
      //setup proxy connection:
      clientCfg.setProxyHost("192.168.2.12");
      clientCfg.setProxyPort(80);
  
  
  
  
      AmazonS3 s3 = new AmazonS3Client(basicCred, clientCfg);
  
  
      String bucketName = "mybucket";
      String key = "/test/Capture.JPG";
      File file = new File("d:/Test_Data/Capture.JPG");
  
      System.out.println("Uploading a new object to S3 from a file");
      s3.putObject(new PutObjectRequest(bucketName, key, file));
  </code></pre>
  
  <p>However this is the error I got from running the program:</p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
      at com.amazonaws.util.BinaryUtils.fromHex(BinaryUtils.java:69)
      at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1066)
      at javaapplication8.JavaApplication8.main(JavaApplication8.java:48)
  Java Result: 1
  </code></pre>
  
  <p>I'm using the latest aws 1.3.8 sdk from amazon. The proxy is set up in another PC next to me and it's just a simple Javascript proxy (http://www.catonmat.net/http-proxy-in-nodejs/)</p>
  
  <p>I can't figure it out why. Somebody can help me, please?</p>