SetCustomProxy(null) throws exception...Solved

Hi

Calling SetCustomProxy(null) throw a GeneralTurboActivateException. Are you not supposed to call this function with null unless you have previously called it with non-null or not String.Empty.

(in C# btw).

Please advise.

OK - now I'm really confused how this is supposed to work.

When I pass in a 'junk' proxy string to SetCustomProxy or TurboActivate.exe I would expect the internet connection to fail - it doesn't. Is this correct?

NOTE: we don't currently use a proxy server and go straight out to our ISP.

See the following functions:

internal static String GetCustomProxy() { //TurboActivate.exe --proxy="http://username:password@host:port/" String customProxyString = null; String customProxyFileName = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\" + Properties.Resources._CustomProxyFileName;

if (File.Exists(customProxyFileName) == true) { String txtString = String.Empty; using (StreamReader sr = new StreamReader(customProxyFileName)) { txtString = sr.ReadToEnd(); } if (txtString == null || txtString.Length == 0) customProxyString = String.Empty; else if (txtString != String.Empty) customProxyString = txtString; MessageBox.Show("CustomProxy=='"+customProxyString+"'"); } else MessageBox.Show("CustomProxy NOT FOUND"); return customProxyString; }

AND this snippet...

// launch TurboActivate.exe to get the product key from the user Process TAProcess = new Process { StartInfo = { FileName = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "TurboActivate.exe"), Arguments = xxxxxxLicensing.GetCustomProxy() }, EnableRaisingEvents = true };

TAProcess.Exited += p_Exited; TAProcess.Start(); TAProcess.WaitForInputIdle(); //Wait for the process to end. TAProcess.WaitForExit();

Calling SetCustomProxy(null) throw a GeneralTurboActivateException. Are you not supposed to call this function with null unless you have previously called it with non-null or not String.Empty.

Sorry -- this is a bug. It shouldn't throw an exception when you pass in a null string. We'll fix this for TurboActivate 3.1

When I pass in a 'junk' proxy string to SetCustomProxy or TurboActivate.exe I would expect the internet connection to fail - it doesn't. Is this correct?

NOTE: we don't currently use a proxy server and go straight out to our ISP.

TurboActivate tries the proxy first and if the proxy fails, TurboActivate still tries to connect directly. Does that make sense?

Hi,

When will 3.1 be out I kinda need this now...

When you say "TurboActivate tries the proxy first and if the proxy fails, TurboActivate still tries to connect directly" - do you mean via the proxy defined in IE or bypassing all proxies all together????

Please advise.

When will 3.1 be out I kinda need this now...

In a few days.

When you say "TurboActivate tries the proxy first and if the proxy fails, TurboActivate still tries to connect directly" - do you mean via the proxy defined in IE or bypassing all proxies all together????

Whatever proxy that's configured (either through IE or a custom proxy). So if TurboActivate tries connecting through the proxy and it fails, then TurboActivate tries connecting directly.

TurboActivate 3.1 is now out -- this bug is fixed.

Can you clarify what this means from the proxy help page on the website:

"To bypass the system proxies pass in an empty string value." -- does this utilize the concept you discussed in a previous post where by if connecting to the proxy fails [in this case a 'blank' proxy string] then you try can connect directly???

Please advise.

Thanks

If you're using a custom proxy (or the system has proxies set) then TurboActivate does the following:

  1. It tries connecting via the proxy or proxies.
  2. If that fails it tries connecting directly.

If both of those options fail then TurboActivate returns an error.

Does that make sense?

I understand that.

I want to know is meant by this "To bypass the system proxies pass in an empty string value." and how it relates to the sequence you just mentioned. It's confusing.

Also, This is causing us issues at a client which is a university. I suspect they have a fairly strict group policy setup and TurboActivate is failing to connect. Can you give me some ideas on what in the group policy will be restricting access. This is becoming a serious issue and our client is not best pleased.

Also, This is causing us issues at a client which is a university

What's the error exactly? If you're in C/C++ what's the return code (TA_E_...)? If you're in any other language then what's the thrown exception?

This is important. It tells you exactly what the type of error is.

I want to know is meant by this "To bypass the system proxies pass in an empty string value." and how it relates to the sequence you just mentioned. It's confusing.

To "bypass the system proxies" means to skip the proxies on the computer and just try to connect directly (on Windows these proxies are set in the Internet Explorer configuration options).

I will have to come back to you regarding the internet connection issue.

With regard to setting the custom proxy via the SetCustomProxy method. Can you clarify if the "--proxy" part of the custom proxy string should be passed into the method -- or is this just for the command line.

Cheers

The "--proxy=" is only necessary when using the TurboActivate wizard. So this:

TurboActivate.exe --proxy="http://username:password@host:port/"

is equivalent to this:

SetCustomProxy("http://username:password@host:port/")