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

CyberSource proxy configuration overriding default proxy configuration #19

Closed
flavio1110 opened this issue May 11, 2016 · 4 comments
Closed

Comments

@flavio1110
Copy link

flavio1110 commented May 11, 2016

I have a default proxy configuration in my web.config/app.config like:

 <system.net>
    <defaultProxy>
      <proxy
        proxyaddress="MY_PROXY_URL"
        bypassonlocal="True"/>
      <bypasslist>
        <add address="MY_URL_TO_BYPASS_FOR_ANOTHER_SERVICE" />
      </bypasslist>
    </defaultProxy>
  </system.net>`

1) First issue:

CyberSourceLibrary doesn't use the default configuration, so I need to repeat the proxy again in cybersource proxy configuration like:

<add key="cybs.proxyURL" value="MY_PROXY_URL"/>

2) Second issue:

When I do this, the library override my default configuration and I lost my by pass definition.

It is the code (BaseClient.cs line # 323):

if (mProxy != null)
{
      WebRequest.DefaultWebProxy = mProxy;
          httpsTransport.UseDefaultWebProxy = true;
}

This code should be changed as well (BaseClient.cs line # 48):

if (proxyURL != null)
{
    mProxy = new WebProxy(proxyURL);

    // if a proxyUser is specified in the configuration file,
    // set up the proxy object's Credentials.
    string proxyUser
        = AppSettings.GetSetting(null, PROXY_USER);
    if (proxyUser != null)
    {
        string proxyPassword
            = AppSettings.GetSetting(null, PROXY_PASSWORD);

        NetworkCredential credential
            = new NetworkCredential(proxyUser, proxyPassword);

        CredentialCache cache = new CredentialCache();
        cache.Add(new Uri(proxyURL), BASIC_AUTH, credential);
        mProxy.Credentials = cache;
    }
}

It should be smart to use the default proxy and if I have a different proxy for CyberSource calls, the library can not override my default configuration.

@amie-gao
Copy link
Contributor

amie-gao commented Feb 8, 2017

yes the issue is logged and we will work on solution shortly.

@amie-gao amie-gao closed this as completed Feb 8, 2017
@flavio1110
Copy link
Author

So, why is it closed?

@amie-gao
Copy link
Contributor

amie-gao commented Feb 8, 2017

reopen. closed accidently.

@amie-gao amie-gao reopened this Feb 8, 2017
@O-Mutt
Copy link

O-Mutt commented Nov 29, 2018

@flavio1110 there are two PRs open related to this issue PR #30 and #17

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

3 participants