首页 > 解决方案 > 条纹购买在本地工作正常,主机超时(1&1)

问题描述

我正在使用 ASP.net Framework 4.8、Visual Studio 2019 社区和 Stripe 的官方 Nuget 包 v28.8.0。

我正在使用 Stripe Elements 和我的测试密钥来创建客户并完成购买。在本地,在我的机器上,它没有问题地通过。我可以创建客户、从他们的服务器获取数据等。

当我部署到 1&1 并尝试使用 Stripe 做任何事情(除了在页面上加载元素之外),它给了我这个错误:

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 34.200.47.89:443
[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 34.200.47.89:443]
System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult) +923
System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) +84
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) +259

 [WebException: Unable to connect to the remote server]
 System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) +579
 System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar) +107

它应该创建一个客户并购买一个项目,但它只是冻结并每次都超时。

标签: asp.nettimeoutstripe-payments

解决方案


这是他们现在给我的代理服务器:

<system.net>
    <defaultProxy>
      <proxy usesystemdefault = "False" bypassonlocal="True" proxyaddress="http://winproxy.1and1.co.uk:3128" />
    </defaultProxy>
  </system.net>

推荐阅读