[Mono-bugs] [Bug 691291] Incomplete proxy support/ system wide proxy bypass list is ignored

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Oct 6 02:10:36 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=691291

https://bugzilla.novell.com/show_bug.cgi?id=691291#c6


--- Comment #6 from QuickJack . <test051102 at hotmail.com> 2011-10-06 06:10:34 UTC ---
As I said in "Comment 5", proxy settings can be configured via web.config.
Following is a simple example section which configures a proxy server and an ip
address to bypass.

<system.net>
    <defaultProxy>
        <proxy usesystemdefault="false" proxyaddress="http://my.proxy.com" />
        <bypasslist>
            <add Address="192.168.1.20"/>
        </bypasslist>
    </defaultProxy>
</system.net>


Problems:

(1) WebRequest.GetDefaultWebProxy() does not respect the bypass list and needs
to be extended as follows:

    [MonoTODO("Needs to respect Module, Proxy.AutoDetect, and
Proxy.ScriptLocation config settings")]
    static IWebProxy GetDefaultWebProxy ()
    {
#if CONFIGURATION_DEP
        DefaultProxySection sec = ConfigurationManager.GetSection
("system.net/defaultProxy") as DefaultProxySection;
        WebProxy p;

        if (sec == null)
            return GetSystemWebProxy ();

        ProxyElement pe = sec.Proxy;

        if ((pe.UseSystemDefault != ProxyElement.UseSystemDefaultValues.False)
&& (pe.ProxyAddress == null))
            p = (WebProxy) GetSystemWebProxy ();
        else
            p = new WebProxy ();

        if (pe.ProxyAddress != null)
            p.Address = pe.ProxyAddress;

        if (pe.BypassOnLocal != ProxyElement.BypassOnLocalValues.Unspecified)
            p.BypassProxyOnLocal = (pe.BypassOnLocal ==
ProxyElement.BypassOnLocalValues.True);

        //process bypass list
        foreach(BypassElement elem in sec.BypassList)
            p.BypassArrayList.Add(elem.Address);

        return p;
#else
        return GetSystemWebProxy ();
#endif
    }
#endif


(2) System.ConfigurationException because of typo in
ProxyElement.ProxyElement()

Line 61 in ProxyElement.cs needs to be changed as follows;
useSystemDefaultProp = new ConfigurationProperty ("usesystemdefault", typeof
(UseSystemDefaultValues), UseSystemDefaultValues.Unspecified);

According to MSDN the property should read "usesystemdefault" and NOT
"UseSystemDefault"


(3) System.ConfigurationException because of typo in
BypassElement.BypassElement()

Line 52 in BypassElement.cs needs to be changed as follows:
addressProp = new ConfigurationProperty ("address", typeof (string), null,
ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);

According to MSDN the property should read "address" and NOT "Address"

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list