【问题标题】:Chilkat HTTPS The plain HTTP request was sent to HTTPS portChilkat HTTPS 将纯 HTTP 请求发送到 HTTPS 端口
【发布时间】:2019-09-12 22:14:02
【问题描述】:

我正在使用 Chilkat ActiveX (Delphi) 9.5 版。 我使用 TChilkatHTTP 将一些数据发布到 HTTPS url。

http.SynchronousRequest(Host,443,0,req.ControlInterface);

我得到的响应是“普通 HTTP 请求已发送到 HTTPS 端口”

我已经在 Google 上搜索了很多天以寻求解决方案,但无法找到可行的解决方案。请如果有人知道我错过了什么。

非常感谢。

以下是 Chilkat 日志:

---- Sending ----
POST /qrCreate HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: api-testing.payhalal.my
Content-Length: 232

app_id=app-testing-d2277670007a30c2e6b6919fdfc696dd&amount=&currency=MYR&product_description=MY%20PRODUCT&order_id=12345&customer_name=SHELY&customer_email=eeshely%40gmail.com&customer_phone=0127806698&language=EN&timeout=3600&hash=
---- Received ----
HTTP/1.1 400 Bad Request
Server: nginx
Date: Thu, 12 Sep 2019 10:23:07 GMT
Content-Type: text/html
Content-Length: 264
Connection: close
Strict-Transport-Security: max-age=31536000; includeSubDomains

<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
<hr><center>nginx</center>
</body>
</html>
<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
<hr><center>nginx</center>
</body>
</html>

【问题讨论】:

    标签: post https chilkat


    【解决方案1】:

    改变

    http.SynchronousRequest(Host,443,0,req.ControlInterface); 
    

    到这里:

    http.SynchronousRequest(Host,443,1,req.ControlInterface); 
    

    参数 3 表示是否应使用 TLS。第二个参数只是端口号。

    【讨论】:

      猜你喜欢
      • 2019-05-01
      • 2015-09-08
      • 2019-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-26
      • 2017-02-01
      相关资源
      最近更新 更多