Curl 为什么ofx请求会失败?

Curl 为什么ofx请求会失败?,curl,ofx,Curl,Ofx,我正试图下载的个人资料,但它没有给我一个正确的答复。我可以看出,ofxhome能够得到它,而 我从OFX测试工具获取了请求,并将其保存为OFX.txt: OFXHEADER:100 DATA:OFXSGML VERSION:102 SECURITY:NONE ENCODING:USASCII CHARSET:1252 COMPRESSION:NONE OLDFILEUID:NONE NEWFILEUID:NONE <OFX><SIGNONMSGSRQV1><SON

我正试图下载的个人资料,但它没有给我一个正确的答复。我可以看出,ofxhome能够得到它,而

我从OFX测试工具获取了请求,并将其保存为OFX.txt:

OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:NONE
ENCODING:USASCII
CHARSET:1252
COMPRESSION:NONE
OLDFILEUID:NONE
NEWFILEUID:NONE

<OFX><SIGNONMSGSRQV1><SONRQ><DTCLIENT>20150220033100<USERID>anonymous00000000000000000000000<USERPASS>anonymous00000000000000000000000<LANGUAGE>ENG<FI>
<ORG>AFS
<FID>11326
</FI>
<APPID>QWIN<APPVER>2000</SONRQ></SIGNONMSGSRQV1><PROFMSGSRQV1><PROFTRNRQ><TRNUID>1424403060<PROFRQ><CLIENTROUTING>MSGSET<DTPROFUP>19970101</PROFRQ></PROFTRNRQ></PROFMSGSRQV1></OFX>
我得到这个输出:

* Rebuilt URL to: https://jmsofx.automatedfinancial.com/
*   Trying 147.249.46.82...
* Connected to jmsofx.automatedfinancial.com (147.249.46.82) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: /opt/local/share/curl/curl-ca-bundle.crt
  CApath: none
* TLSv1.2, TLS Unknown, Unknown (22):
* TLSv1.2, TLS handshake, Client hello (1):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Server hello (2):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, CERT (11):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Server finished (14):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Client key exchange (16):
* SSLv2, Unknown (20):
* TLSv1.2, TLS change cipher, Client hello (1):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Finished (20):
* SSLv2, Unknown (20):
* TLSv1.2, TLS change cipher, Client hello (1):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / AES128-SHA
* Server certificate:
*    subject: C=US; ST=Alabama; L=Birmingham; O=SunGard Business Systems LLC; CN=jmsofx.automatedfinancial.com
*    start date: 2014-04-28 00:00:00 GMT
*    expire date: 2015-07-24 23:59:59 GMT
*    subjectAltName: jmsofx.automatedfinancial.com matched
*    issuer: C=US; O=Thawte, Inc.; CN=Thawte SSL CA
*    SSL certificate verify ok.
* SSLv2, Unknown (23):
> POST / HTTP/1.1
> User-Agent: curl/7.40.0
> Host: jmsofx.automatedfinancial.com
> Content-Type:application/x-ofx
> Accept:*/*, application/x-ofx
> Content-Length: 505
> 
* upload completely sent off: 505 out of 505 bytes
* SSLv2, Unknown (23):
< HTTP/1.1 200 OK
< Server: AFS-Prospero/6.32.00
< Date: Fri, 20 Feb 2015 03:41:11 GMT
< Last-modified: Wed, 28 Aug 2013 10:14:42 GMT
< Content-type: text/html
< Content-length: 317
< 
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JAVASCRIPT"><!--
var host=window.location.hostname;
if(window.location.protocol=="https:") host=window.location.host;
window.location.href='https://'+host+'/secure_login.html';
//-->
</SCRIPT>
<link rel="stylesheet" type="text/css" href="/css/retail_style.css"></head>
* Connection #0 to host jmsofx.automatedfinancial.com left intact
</HTML>
*重建的URL到:https://jmsofx.automatedfinancial.com/
*正在尝试147.249.46.82。。。
*已连接到jmsofx.automatedfinancial.com(147.249.46.82)端口443(#0)
*已成功设置证书验证位置:
*CAfile:/opt/local/share/curl/curl-ca-bundle.crt
卡帕斯:没有
*TLSv1.2,TLS未知,未知(22):
*TLSv1.2,TLS握手,客户端你好(1):
*SSLv2,未知(22):
*TLSv1.2,TLS握手,服务器你好(2):
*SSLv2,未知(22):
*TLSv1.2,TLS握手,证书(11):
*SSLv2,未知(22):
*TLSv1.2,TLS握手,服务器完成(14):
*SSLv2,未知(22):
*TLSv1.2,TLS握手,客户端密钥交换(16):
*SSLv2,未知(20):
*TLSv1.2,TLS更改密码,客户端hello(1):
*SSLv2,未知(22):
*TLSv1.2,TLS握手,完成(20):
*SSLv2,未知(20):
*TLSv1.2,TLS更改密码,客户端hello(1):
*SSLv2,未知(22):
*TLSv1.2,TLS握手,完成(20):
*使用TLSv1.2/AES128-SHA的SSL连接
*服务器证书:
*主题:C=美国;ST=阿拉巴马州;L=伯明翰;O=SunGard商业系统有限责任公司;CN=jmsofx.automatedfinancial.com
*开始日期:2014-04-28 00:00:00 GMT
*过期日期:2015-07-24 23:59:59 GMT
*主题名称:jmsofx.automatedfinancial.com
*发行人:C=美国;O=Thawte公司。;CN=解冻SSL CA
*SSL证书验证正常。
*SSLv2,未知(23):
>POST/HTTP/1.1
>用户代理:curl/7.40.0
>主持人:jmsofx.automatedfinancial.com
>内容类型:应用程序/x-ofx
>接受:*/*,应用程序/x-ofx
>内容长度:505
> 
*上传已完全发送:505字节中的505字节
*SSLv2,未知(23):
我尝试过DOS和UNIX风格的行结尾


我已经能够用这种方法与其他机构建立联系。我做错了什么

要回答我自己的问题,问题在curl命令行中-在“content type:”和“application/x-ofx”之间应该有一个空格:

* Rebuilt URL to: https://jmsofx.automatedfinancial.com/
*   Trying 147.249.46.82...
* Connected to jmsofx.automatedfinancial.com (147.249.46.82) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: /opt/local/share/curl/curl-ca-bundle.crt
  CApath: none
* TLSv1.2, TLS Unknown, Unknown (22):
* TLSv1.2, TLS handshake, Client hello (1):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Server hello (2):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, CERT (11):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Server finished (14):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Client key exchange (16):
* SSLv2, Unknown (20):
* TLSv1.2, TLS change cipher, Client hello (1):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Finished (20):
* SSLv2, Unknown (20):
* TLSv1.2, TLS change cipher, Client hello (1):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / AES128-SHA
* Server certificate:
*    subject: C=US; ST=Alabama; L=Birmingham; O=SunGard Business Systems LLC; CN=jmsofx.automatedfinancial.com
*    start date: 2014-04-28 00:00:00 GMT
*    expire date: 2015-07-24 23:59:59 GMT
*    subjectAltName: jmsofx.automatedfinancial.com matched
*    issuer: C=US; O=Thawte, Inc.; CN=Thawte SSL CA
*    SSL certificate verify ok.
* SSLv2, Unknown (23):
> POST / HTTP/1.1
> User-Agent: curl/7.40.0
> Host: jmsofx.automatedfinancial.com
> Content-Type:application/x-ofx
> Accept:*/*, application/x-ofx
> Content-Length: 505
> 
* upload completely sent off: 505 out of 505 bytes
* SSLv2, Unknown (23):
< HTTP/1.1 200 OK
< Server: AFS-Prospero/6.32.00
< Date: Fri, 20 Feb 2015 03:41:11 GMT
< Last-modified: Wed, 28 Aug 2013 10:14:42 GMT
< Content-type: text/html
< Content-length: 317
< 
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JAVASCRIPT"><!--
var host=window.location.hostname;
if(window.location.protocol=="https:") host=window.location.host;
window.location.href='https://'+host+'/secure_login.html';
//-->
</SCRIPT>
<link rel="stylesheet" type="text/css" href="/css/retail_style.css"></head>
* Connection #0 to host jmsofx.automatedfinancial.com left intact
</HTML>
curl -v -X POST --data-binary @ofx.txt --header "Content-Type: application/x-ofx" --header "Accept:*/*, application/x-ofx" https://jmsofx.automatedfinancial.com