Hitachi Content Platform​

 View Only

 About "Failed to authenticate with proxy"

  • Object Storage
  • Hitachi Content Platform HCP
  • Hitachi Content Platform HCP Anywhere
Shing Yuen Lee's profile image
Shing Yuen Lee posted 11-05-2018 05:24

Hi Sir/Madam,

I downloaded "AwSdkTest" Java program for testing download and upload files. It works fine without proxy.

But it failed with error message "Failed to authenticate with proxy" when there is proxy.

Here are my codes:

Properties systemSettings = System.getProperties();

systemSettings.put("proxySet", "true");

systemSettings.put("http.proxyHost", "userproxy.XXXXXX.com");

systemSettings.put("http.proxyPort", "80");

Proxy proxy3 = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("userproxy.XXXXXX.com", 80));

System.out.println("proxy TYPE : " + proxy3.type());

InetSocketAddress addr = (InetSocketAddress) proxy3.address();

if (addr == null) {

System.out.println("No Proxy");

} else {

System.out.println("proxy hostname : " + addr.getHostName());

System.out.println("proxy port : " + addr.getPort());

}

api = new AnywhereAPI.Builder("https://hcpanywhere.hitachivantara.com:443").proxy(proxy3).insecureSSL()

  .skipHostnameVerification().build();

Do you have any idea to resolve the issue?

Thanks!!

Regards,

George Lee


#HitachiContentPlatformHCPAnywhere
#HitachiContentPlatformHCP
Joseph Wesley's profile image
Joseph Wesley

George,

Are you using authenticated proxy? AwFssSdk does not currently support that.

The Proxy proxy3 = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("userproxy.XXXXXX.com", 80));` step is the correct approach but you don't need to do any of the systemSettings.put() steps if you are using unauthenticated Proxy.

-joe

Shing Yuen Lee's profile image
Shing Yuen Lee

Dear Joe,

The proxy requires authentication.

That's mean I need to save the Proxy in Internet Explorer and required to input the username, password when I browse web site.

However, I try to run the above codes for many times. It rarely execute successfully (about 1% success rate).

Therefore, I feel strange about this behavior.

Thanks for your reply.

Regards,

George Lee

Joseph Wesley's profile image
Joseph Wesley

George,

Is your 1% success rate referring to the case w/ no proxy?

thanks

Shing Yuen Lee's profile image
Shing Yuen Lee

Hi Joe,

The rarely success process was also using Proxy with the codes initially posted.

Thanks!!