当我在Erlang 21中执行以下操作时出现错误.
inets:start(),
ssl:start(),
httpc:request(post,
{"https://sandbox.itunes.apple.com/verifyReceipt", [], "application/json", []},
[], []).
Run Code Online (Sandbox Code Playgroud)
错误是:
=INFO REPORT==== 3-Oct-2018::19:32:47.728491 ===
TLS client: In state hello received SERVER ALERT: Fatal - Handshake Failure
{error,{failed_connect,[{to_address,{"sandbox.itunes.apple.com",443}},
{inet,[inet],{tls_alert,"handshake failure"}}]}}
Run Code Online (Sandbox Code Playgroud)
当我在Erlang 20中做同样的事情时,它工作得很好.
谁能让我知道可能出错的地方?
做了一些研究,发现由于OTP 21的亮点
安全性:从SSL和SSH中的默认值中删除了"不安全"密码.
您需要手动配置SSL(启用密码)
EnabledCiphers = ssl:cipher_suites(all, 'tlsv1.2'),
Options = [{ciphers, EnabledCiphers}],
httpc:request(post,{"https://sandbox.itunes.apple.com/verifyReceipt",
[],"application/json", []}, [{ssl,Options}], []).
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
292 次 |
| 最近记录: |