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 8931133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:02:45+00:00 2026-06-15T09:02:45+00:00

Trying to load some data off my server (xml data). I normally just use

  • 0

Trying to load some data off my server (xml data). I normally just use HttpWebRequest as I can set the utomaticDecompression to DecompressionMethods.GZip | DecompressionMethods.Deflate in order to use gzip compression of my data automatically.

Recently a client has emailed me saying that it does not work from within his school. Sent out another copy of the app to him via TestFlightApp to get more debugging info from him and the app responds with a 407 auth error. Since then I have set up a proxy on my computer which I redirect my iPhone traffic through to test on.

My original setup was like so,

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(_url);
request.CachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
request.Proxy = null;
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
WebResponse response = request.GetResponse();

and then so on from there.

I’d set Proxy to null because in most cases the user would not be behind a proxy and this cut off 1-2 seconds of proxy resolving. There is code later to catch this and then re-create the HttpWebRequest but by not nulling the proxy, which I thought would be default proxy. Apparently not so…

I tried to then get the default proxy settings of the device.

CFProxySettings proxy0 = CFNetwork.GetSystemProxySettings();
IWebProxy proxy1 = WebRequest.GetSystemWebProxy();
IWebProxy proxy2 = HttpWebRequest.DefaultWebProxy;
IWebProxy proxy3 = HttpWebRequest.GetSystemWebProxy();
IWebProxy proxy4 = CFNetwork.GetDefaultProxy();

proxy1 – proxy4 have null for the credentials. proxy0 contains proxy information which I need such as proxy url, port, username, but no password…

I manually made a WebProxy with my credentials

WebProxy webProxy = new WebProxy(proxy0.HTTPProxy, proxy0.HTTPPort);
webProxy.Credentials = new NetworkCredential("user", "pass");
request.Proxy = webProxy;

and this works.
Falling short of requesting username and password for the proxy on a 407 error I am not sure what to do…
WebClient downloads do not work, but UIWebView and MKMapView does auto-auth itself.

Any ideas what I am missing?

EDIT:

Found this, https://bugzilla.xamarin.com/show_bug.cgi?id=1081

  • 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-15T09:02:46+00:00Added an answer on June 15, 2026 at 9:02 am

    I had a look at this today, doing a lot of debugging and browsing Apple’s Documentation – and I’m afraid, I don’t have a positive answer for you – unless you consider “impossible” as a positive answer …

    The Problem in General

    According to Apple’s Documentation, CFProxySupport does not give you access to the stored proxy credentials.

    There is an – undocumented – way of getting the proxy username (the returned dictionary uses strings as keys, one of these keys is called “HTTPUser” or “HTTPProxyUsername”, but I couldn’t find any string constant for it), but not the password.

    On Mac OS X

    There is actually a solution on Mac OS X: when I ran a simple NSURLConnection based example, it asked me for permission to access the keychain, so I opened the Keychain Utility and found the proxy credentials in the login keychain. I also wrote a simple Objective C function to retrieve it, but you need to know the proxy user name (but I haven’t tried using NULL, maybe that works).

    I also couldn’t find any way of checking whether authentication is required at all, except by checking whether that username is NULL. Unfortunately, you need keychain access privileges to check whether some item exists, so we need to make sure that authentication is actually requierd. One way of doing that would be from inside HttpWebConnection after it already received the HTTP 407 (and of these also contain the desired username).

    On iOS

    From what I’ve read so far on the internet, iOS does not let you access the system keychain – I’m not even sure whether that exists at all. The CFProxySupport also doesn’t return any credentials.

    Fwiw., you also don’t ever need to know the proxy password unless you want to do HTTP access without using the iOS APIs for it. So there’s a decent chance that there’s just no way of retrieving it.

    As a solution, you could either use the iOS APIs such as NSURLConnection or WebClient with the CFNetwork handler.

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

Sidebar

Related Questions

I am trying to load some XML data into C++ code (classes) using gsoap.
I'm trying to use the OleDb CSV parser to load some data from a
I'm trying to load some binary data from server like this var urlRequest:URLRequest =
I am trying to use load() to place some html into a div on
I'm trying to scrape some data off of the FEC.gov website using python for
I am trying to load some data (which may be up to a few
I'm trying to load some data from a plist file. It contains an NSArray
I am trying to load some JSON data into to a table using the
I am trying to load some GZIP-ed data from a resource in my .jar,
I am trying to load some data from a text file into a vector

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.