Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8949921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:19:50+00:00 2026-06-15T13:19:50+00:00

This is somewhat of a speculative question in that the answer may not be

  • 0

This is somewhat of a speculative question in that the answer may not be apparent in the info I have available, but I am hoping that someone with sufficient experience will recognize a likely answer based on common practices for corporate proxies.

I work (not as a software developer) behind a corporate proxy. In my spare time I was messing around with a Java program I’m developing. This program needs to make a few very simple HTTP GET requests, and I’m using Apache HttpClient for that. I was concerned at first about whether or not I’d make it through the proxy server. In our web browsers, the proxy server is simple entered into the network settings… no authentication needed. So, I added the following to my Java program:

myClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, MY_PROXY);

Sure enough, it worked! However, I had another concern. The HTTP requests coming from my program probably had some strange User-Agent specified (I’ve since confirmed this is the case), and I did not want them to ever trigger any sort of suspicion in automated or manual packet inspections. So I said to myself, “why not just set the User-Agent header to be the same as the browser on this machine?”

myClient.getParams().setParameter(CoreProtocolPNames.USER_AGENT, BROWSER_AGENT);

Here is where it gets weird. If the BROWSER_AGENT string above is set to exactly the same value as the corporate supplied browser on my machine (either IE or FF), I get an “authentication failed, missing credentials” type error message returned from the corporate proxy server. But, if I set the User-Agent header to something generic, like say Mozilla 5.0 or even a totally bogus string, or even an empty string, it all works fine! The parts that confuse me are:

  • When User-Agent is set to the same as my browser (a long complex string), I “fail authentication” somehow, which makes no sense since in the real browser I provide no authentication information (unless it comes from some pre-installed certificate maybe?)
  • If the corporation requires authentication for any requests sent to the proxy server on port 80, then how come they let random User-Agent strings get through? Oversight? Some other reason I can’t comprehend?

Hopefully this question is not too speculative to be deemed constructive. I’d love to hear from people with experience in this area. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:19:51+00:00Added an answer on June 15, 2026 at 1:19 pm

    By default, HTTPClient identifies itself as the user agent. As you have seen, you can override this to any string you want.

    Looks like your proxy servers is configured to automatically add user credentials based on browser type however due to some exception found, your admin added an exception rule, ie, when the user-agent is not known, just let it through. Personally, I think it is a very bad security policy since as you found out, all program can go through your proxy without authentication just by using a bogus user-agent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is somewhat different question or maybe a easy question. but I have this
I apologize in advance for this somewhat ignorant question, but I have researched this
This is somewhat of a general question, but I'm sure I'm not the only
This is somewhat related to the question posed in this question but I'm trying
I know this is somewhat subjective, but I can't find an honest answer anywhere.
This is not 100% programming related. But I think this is somewhat useful because
This is somewhat related to a question I asked not too long ago today.
This is somewhat related to this question . Let's say I have a package
Is it possible to have nested set capabilities in this somewhat custom setup? Consider
This is somewhat complex (well to me at least). Here is what I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.