fix(http): reject Hackney's certifi partial chains
Hackney 4 merges given ssl_options into its defaults and keeps its own partial_chain, which trusts any certificate in the peer chain that is in certifi. A peer could send the emSign ECC Root CA - G3 root in its chain and pass. Set partial_chain so certifi is never a trust anchor.
This commit is contained in:
parent
92a112cf15
commit
65076aa2f8
2 changed files with 15 additions and 3 deletions
|
|
@ -17,6 +17,12 @@ defmodule Pleroma.HTTP.TLSTest do
|
|||
assert is_function(match_fun, 2)
|
||||
end
|
||||
|
||||
test "does not accept certificates from the peer chain as trust anchors" do
|
||||
partial_chain = TLS.ssl_options()[:partial_chain]
|
||||
|
||||
assert partial_chain.([:certificate]) == :unknown_ca
|
||||
end
|
||||
|
||||
test "keeps the CA bundle when other options are given" do
|
||||
opts = TLS.ssl_options(versions: [:"tlsv1.2"])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue