azure - Paypal IPN 返回 302

标签 azure ssl paypal

我最近向我的网站添加了 SSL 证书,现在我的 PayPal IPN 监听器不再有效。它已经工作了一年多没有问题。

            // Postback to either Sandbox or Live.
            string strPayPal = "https://www.paypal.com/cgi-bin/webscr";
            BasicCrudToolkit.LogMessage("PayPal Webrequest created", "PayPal Listener");
            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strSandbox);

            // Set values for request back.
            req.Method = "POST";
            req.ContentType = "application/x-www-form-urlencoded";
            Byte[] param = Request.BinaryRead(HttpContext.Current.Request.ContentLength);
            string strRequest = Encoding.ASCII.GetString(param);
            BasicCrudToolkit.LogMessage("Request parameters: " + strRequest, "PayPal Listener");

            strRequest += "&cmd=_notify-validate";
            req.ContentLength = strRequest.Length;

            // Send request to PayPal and get request.
            StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), Encoding.ASCII);
            streamOut.Write(strRequest);
            streamOut.Close();
            StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream());
            string strResponse = streamIn.ReadToEnd();
            streamIn.Close();

当我在 PayPal 上查看我的 IPN 历史记录时,HTTP 响应代码中没有显示任何内容,并且 IPN 显示在永久重试中。但是,当我检查 Azure 上的流量时,我发现该站点正在返回 302。

如您所见,我有一个日志文件,它在 IPN 执行时生成条目。我没有在日志文件中得到任何条目。这几乎就像 Azure 在 Listener 可以运行之前就拒绝了来自 PayPal 的 IPN 请求。在我运行 SSL 证书后,Azure 上是否缺少某些设置?

我的技术专长有点不够用了,我想得到一些关于下一步调试的建议。

最佳答案

302 是重定向,因此听起来您必须将站点配置为将 http://流量重定向到 https://。您应该能够更新您的 IPN URL 以使用 https://而不是 http://来解决它。

关于azure - Paypal IPN 返回 302,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31640860/

相关文章:

Azure 数据工厂链接服务文件系统错误

azure - 如何从 Web 应用程序 (AZURE) 按需启动 AKS 中的 Linux 脚本

ssl - 如何使用客户端证书从 Kong 无服务器功能建立 SSL 连接

android - 以编程方式向给定帐户发送付款 - Paypal android SDK

Paypal Adaptive Payment IPN 费用信息

c# - C# 中的 Paypal IPN 监听器问题

java - 文件上传文件名编码

azure - 无法将 Azure 中的 SSL 绑定(bind)应用到 Web 应用服务

java - 如何将客户端证书添加到 Spring WebClient?

ruby - Redmine通过SSL连接SVN