Smartling / api-sdk-java

This SDK is no longer maintained and is superceeded by Smartling's java-api-sdk.
https://github.com/Smartling/java-api-sdk
13 stars 15 forks source link

Support proxy w/o authentication #13

Closed dlyash closed 8 years ago

dlyash commented 9 years ago

If java application is started with proxy settings, e.g. -Dhttps.proxyHost=localhost -Dhttps.proxyPort=8888, we will get

java.lang.IllegalArgumentException: Username may not be null
    at org.apache.http.util.Args.notNull(Args.java:48)
    at org.apache.http.auth.UsernamePasswordCredentials.<init>(UsernamePasswordCredentials.java:78)
    at com.smartling.api.sdk.util.HttpProxyUtils.getHttpClient(HttpProxyUtils.java:70)
    at com.smartling.api.sdk.util.HttpUtils.executeHttpCall(HttpUtils.java:77)
    at com.smartling.api.sdk.ProjectApiClientAdapterImpl.getProjectLocales(ProjectApiClientAdapterImpl.java:78)
    ...

It seems that library always expects user and password for proxy, even though it's not correct in most cases.

Affected version: 3.0.0

dlyash commented 8 years ago

Fixed in 3.x.x, merged to master as well.