Skip to content

Commit 7d4bd42

Browse files
committed
Add HTTP options docs to README
1 parent 5bb1547 commit 7d4bd42

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,28 @@ Coverage data is imported after tests are run.
549549
550550
See the `mix test` [Coverage documentation](https://hexdocs.pm/mix/Mix.Tasks.Test.html#module-coverage) for more information on `.coverdata`.
551551
552+
### Configuring HTTP Options in ExCoveralls
553+
554+
You can customize the HTTP options used by [`:httpc`](https://www.erlang.org/doc/man/httpc.html) when posting results. The example below shows how to specify a custom `cacertfile`:
555+
556+
```elixir
557+
config :excoveralls, :http_options, [
558+
timeout: 10_000,
559+
ssl:
560+
[
561+
# Refer to the secure coding guide: https://erlef.github.io/security-wg/secure_coding_and_deployment_hardening/inets
562+
verify: :verify_peer,
563+
depth: 2,
564+
customize_hostname_check: [
565+
match_fun: :public_key.pkix_verify_hostname_match_fun(:https)
566+
],
567+
cacertfile: to_charlist(System.fetch_env!("TEST_COVERAGE_CACERTFILE"))
568+
]
569+
]
570+
```
571+
572+
By default, ExCoveralls uses the `cacertfile` from [`castore`](https://hexdocs.pm/castore/api-reference.html) when the dependency is installed. If it's not available and you're running Erlang `25` or later, the system will attempt to use the OS certificates via [`:public_key.cacerts_load/0`](https://www.erlang.org/doc/man/public_key.html#cacerts_load-0).
573+
552574
### Notes
553575
- If mock library is used, it will show some warnings during execution.
554576
- https://github.com/eproxus/meck/pull/17

0 commit comments

Comments
 (0)