Last post Dec 04, 2019 02:40 AM by lpieczynski
Apr 04, 2018 10:42 AM|Shan kHAN|LINK
Summary of the problem I am having:
when i run it on local server it works fine
but when am trying to test Breaintree sandbox app on my remote server on 1and1, i am getting this error
Error I am receiving:
[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 220.127.116.11:443]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +185
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) +496
[WebException: Unable to connect to the remote server]
Braintree.BraintreeService.GetXmlResponse(String URL, String method, Request requestBody, FileStream file) +1302
Braintree.BraintreeService.Post(String URL, Request requestBody) +59
Braintree.ClientTokenGateway.Generate(ClientTokenRequest request) +188
braintree_client.Page_Load(Object sender, EventArgs e) +41
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
System.Web.UI.Control.OnLoad(EventArgs e) +95
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678
public partial class test : System.Web.UI.Page
static private BraintreeGateway gateway = new BraintreeGateway
Environment = Braintree.Environment.SANDBOX,
MerchantId = "***",
PublicKey = "***",
PrivateKey = "***"
public static string clientToken;
protected void Page_Load(object sender, EventArgs e)
clientToken = gateway.ClientToken.Generate();
Apr 04, 2018 03:02 PM|cnranasinghe|LINK
Apr 11, 2018 08:13 PM|Shan kHAN|LINK
thanks for the reply,
yeah on production server there was a firewall setting needed to be update, to enable a blocked port,
even though i don't had access to those settings still issue was resolved with the cooperation of 1and1 customer care support
Apr 12, 2018 03:10 AM|Abraham Qian|LINK
Hi Shan kHAN,
here is my suggestion.
Check your Remote Server Network Settings.
Such as, Close Firewall, Renew IP like your local IP.
Look forward to your reply。
Dec 03, 2019 04:19 AM|immayankmodi|LINK
For 1and1, they don't allow direct calls so need to use proxy. You need to use following lines before making call.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("url");
WebProxy myproxy = new WebProxy("http://ntproxyus.lxa.perfora.net:3128", false);
request.Proxy = myproxy;
request.Method = "GET";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Dec 04, 2019 02:40 AM|lpieczynski|LINK
Thanks! This was very helpful! I was having this same problem with 1and1 and that proxy setting fixed it!