I'm getting this error below, any ideas? Thanks!

No connection could be made because the target machine actively refused it

Exception thrown from line 127 in refreshToken() method in ET_Client.cs.

string json;
using (var streamWriter = new StreamWriter( request.GetRequestStream() )) {

Networking guys said it isn't connection through proxy and should be.

[SocketException (0x274d): No connection could be made because the target machine actively refused it] System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +208 System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) +464

[WebException: Unable to connect to the remote server] System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) +6541489 System.Net.HttpWebRequest.GetRequestStream() +13 FuelSDK.ET_Client.refreshToken(Boolean force) +341 FuelSDK.ET_Client..ctor(NameValueCollection parameters) +2035 TheDreamProject._default.btnSubscribe_Click(Object sender, EventArgs e) in d:\FuelSDK-CSharp-Dot9.zip\FuelSDK-CSharp-Dot9\TheDreamProject\TheDreamProject\default.aspx.cs:30 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9633194 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724


I don't believe your error is related to the SDK. These may help:



  • It was issue with how our internal network handles SSL connections. Running Fiddler fixed the issue. – Gerard Feb 24 '15 at 3:29
  • OK, so when I connect from outside my company network, I'm able to get the connection. So this brings us to the next question. Am I able to configure a proxy in FuelSdk or do I need a firewall hole? If a firewall hole, what port? – Gerard Mar 3 '15 at 6:25
  • Can you post the line of code receiving this error so we can see what you're doing? – Drew Simmons Mar 3 '15 at 14:19
  • added code, think HttpWebRequest request needs to use corporate proxy. – Gerard Mar 4 '15 at 23:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.