Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b2-sdk-httpclient ignoring proxy settings, could not access API #124

Open
anti1869 opened this issue Aug 29, 2020 · 5 comments
Open

b2-sdk-httpclient ignoring proxy settings, could not access API #124

anti1869 opened this issue Aug 29, 2020 · 5 comments

Comments

@anti1869
Copy link

anti1869 commented Aug 29, 2020

Hello.

I am deploying b2 client application behind proxy and it is unable to contact Backblaze API endpoints.
My proxy is definitely working as I have no problems contacting other hosts with other clients.

I believe cause of this is because Apache commons http client does not checking default proxy selector and this means the System Properties like https.proxyHost and https.proxyPort are ineffective.

Since Apache HttpClient seems to have its own way to configure proxies it would be nice to have some of its interface exposed to allow proxy configuration.

As I understood from the docs, it could be done e.g. with RequestConfig.custom().setProxy(new HttpHost(...)), or making HttpClientBuilder use system properties, or some other method.

If this problem could be solved with some other solution, could you please tell me? Thank you.

@certainmagic
Copy link
Contributor

Hi anti1869 --

Sorry for the delayed response. I was backpacking last week.

We are (slowly) working on an implementation of our B2WebApiClient which is built on top of Java's URLConnection class instead of Apache's HttpClient library. If that were available would it you be interested in using it instead of the Apache implementation?

thanks,
ab

@anti1869
Copy link
Author

anti1869 commented Sep 9, 2020

Sure, anything that works. I actually made a workaround bundling my tweaked implementation of webApiHttpClient where I read proxy settings in HttpClientFactoryImpl. I also had to re-enable http connections there, because my app talks to proxy over http.

@certainmagic
Copy link
Contributor

certainmagic commented Sep 9, 2020 via email

@anti1869
Copy link
Author

anti1869 commented Sep 9, 2020

It’s just standard CONNECT tunneling through Squid http proxy. Traffic itself is encrypted. I believe pretty common scheme.

@certainmagic
Copy link
Contributor

certainmagic commented Sep 9, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants