Skip to content

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

Open

Description

@anti1869

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.

Activity

  1. certainmagic commented on Sep 9, 2020

    @certainmagic
    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

  2. anti1869 commented on Sep 9, 2020

    @anti1869
    Author

    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.

  3. certainmagic commented on Sep 9, 2020

    @certainmagic
    Contributor
  4. anti1869 commented on Sep 9, 2020

    @anti1869
    Author

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

  5. certainmagic commented on Sep 9, 2020

    @certainmagic
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions