2014-12-29 17 views
0

我在我建立一個網站集成支付服務,我需要發送以下POST請求https://sis-t.redsys.es:25443/sis/realizarPago發送POST與https://www.hurl.it/的作品,但在命令行用捲曲發送同樣的一個沒有

curl --sslv3 -X POST \ 
-H 'accept: application/json' \ 
-H 'content-type: application/x-www-form-urlencoded' \ 
'https://sis-t.redsys.es:25443/sis/realizarPago' \ 
-d '{ 
    'Ds_Merchant_MerchantSignature': '8A20806C19A5C1D4E25CF26A24F19265CD32F9DE', 
    'Ds_Redsys_Url': 'https://sis-t.redsys.es:25443/sis/realizarPago', 
    'Ds_Merchant_Amount': 1000, 
    'Ds_Merchant_ProductDescription': 'ZZSaas services', 
    'Ds_Merchant_UrlOK': 'http://www.zzsaas.com/redsys/confirm', 
    'Ds_Merchant_ConsumerLanguage': '001', 
    'Ds_Merchant_Titular': 'Zikzakmedia SL', 
    'Ds_Merchant_UrlKO': 'http://www.zzsaas.com/redsys/cancel', 
    'Ds_Merchant_Currency': 978, 
    'Ds_Merchant_MerchantData': None, 
    'Ds_Merchant_Order': '12345ISW', 
    'Ds_Merchant_TransactionType': '0', 
    'Ds_Merchant_MerchantName': 'Zikzakmedia SL', 
    'Ds_Merchant_MerchantCode': '000000000', 
    'Ds_Merchant_Terminal': 1, 
    'Ds_Merchant_MerchantURL': 'http://www.zikzakmedia.com', 
}' 

但該命令返回此錯誤:

curl: (35) error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number 
curl: (6) Could not resolve host: services, 
curl: (6) Could not resolve host: SL, 
curl: (3) [globbing] unmatched close brace/bracket in column 164 

更改--sslv3到--sslv2我得到:

curl: (4) OpenSSL was built without SSLv2 support 
curl: (6) Could not resolve host: services, 
curl: (6) Could not resolve host: SL, 
curl: (3) [globbing] unmatched close brace/bracket in column 164 

更改--sslv3到--tlsv1我得到這個等待60秒後:

curl: (35) Unknown SSL protocol error in connection to sis-t.redsys.es:25443 
curl: (6) Could not resolve host: services, 
curl: (6) Could not resolve host: SL, 
curl: (3) [globbing] unmatched close brace/bracket in column 164 

而且去除--sslv3我得到這個等待60秒後:

curl: (35) Unknown SSL protocol error in connection to sis-t.redsys.es:25443 
curl: (6) Could not resolve host: services, 
curl: (6) Could not resolve host: SL, 
curl: (3) [globbing] unmatched close brace/bracket in column 164 

我也試過以下命令

curl -v https://sis-t.redsys.es:25443/sis/realizarPago 

我也得到

* SSLv3, TLS handshake, Client hello (1): 
* Unknown SSL protocol error in connection to sis-t.redsys.es:25443 

奇怪的是,使與https://www.hurl.it/返回正確的響應webapp的這一請求。

回答

0

我的捲髮版本7.39.0可以正常工作,但不使用任何ssl/tls選項並顯示SSL connection using TLSv1.0/AES128-SHA。除此之外,您的數據包含嵌套的報價和實際包含JSON數據,而不是WWW的形式,進行了urlencoded的數據;這裏有一個修正和優化的命令行:

curl \ 
-H 'accept: application/json' \ 
-H 'content-type: application/json' \ 
https://sis-t.redsys.es:25443/sis/realizarPago \ 
-d '{ 
    "Ds_Merchant_MerchantSignature": "8A20806C19A5C1D4E25CF26A24F19265CD32F9DE", 
    "Ds_Redsys_Url": "https://sis-t.redsys.es:25443/sis/realizarPago", 
    "Ds_Merchant_Amount": 1000, 
    "Ds_Merchant_ProductDescription": "ZZSaas services", 
    "Ds_Merchant_UrlOK": "http://www.zzsaas.com/redsys/confirm", 
    "Ds_Merchant_ConsumerLanguage": "001", 
    "Ds_Merchant_Titular": "Zikzakmedia SL", 
    "Ds_Merchant_UrlKO": "http://www.zzsaas.com/redsys/cancel", 
    "Ds_Merchant_Currency": 978, 
    "Ds_Merchant_MerchantData": None, 
    "Ds_Merchant_Order": "12345ISW", 
    "Ds_Merchant_TransactionType": "0", 
    "Ds_Merchant_MerchantName": "Zikzakmedia SL", 
    "Ds_Merchant_MerchantCode": "000000000", 
    "Ds_Merchant_Terminal": 1, 
    "Ds_Merchant_MerchantURL": "http://www.zikzakmedia.com" 
}'