When I do the following in Erlang 21 I get an error.
inets:start(),
ssl:start(),
httpc:request(post,
{"https://sandbox.itunes.apple.com/verifyReceipt", [], "application/json", []},
[], []).
The error is:
=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"}}]}}
When I do the the same in Erlang 20, it works just fine.
Can someone clue me in on what might be wrong?
Made some research and found that due to OTP 21 Highlights
Security: "unsecure" ciphers removed from defaults in SSL and SSH.
You need to configure SSL manualy (enable ciphers)
EnabledCiphers = ssl:cipher_suites(all, 'tlsv1.2'),
Options = [{ciphers, EnabledCiphers}],
httpc:request(post,{"https://sandbox.itunes.apple.com/verifyReceipt",
[],"application/json", []}, [{ssl,Options}], []).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With