Chilkat HTTPS原始HTTP请求已发送到HTTPS端口

时间:2019-09-12 10:26:02

标签: post https chilkat

我正在使用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>

1 个答案:

答案 0 :(得分:0)

更改

[
    { "keys": ["ctrl+j"], "command": "insert", "args": {"characters": "<"} },
    { "keys": ["ctrl+k"], "command": "insert", "args": {"characters": ">"} }]

对此:

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

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