feat(http): allow to provide self-signed certificates
Allow for the MOBILIZON_CA_CERT_PATH to be used to provide your own root certificates. The CAStore and certify certificates stores should be always already be used as fallback instead of the system store. Closes #1355 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -3,6 +3,17 @@ defmodule Mobilizon.Service.HTTP.Utils do
|
||||
Utils for HTTP operations
|
||||
"""
|
||||
|
||||
def get_tls_config do
|
||||
cacertfile =
|
||||
if is_nil(System.get_env("MOBILIZON_CA_CERT_PATH")) do
|
||||
CAStore.file_path()
|
||||
else
|
||||
System.get_env("MOBILIZON_CA_CERT_PATH")
|
||||
end
|
||||
|
||||
[cacertfile: cacertfile]
|
||||
end
|
||||
|
||||
@spec get_header(Enum.t(), String.t()) :: String.t() | nil
|
||||
def get_header(headers, key) do
|
||||
key = String.downcase(key)
|
||||
|
||||
Reference in New Issue
Block a user