Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# master

* New Configuration Options
* `core_agent_ca_cert` (default: `nil`) — Path to an additional CA certificate to pass to the Core Agent as `--ca-cert <path>` when it is launched. Lets the Core Agent trust a private/self-signed CA (e.g. one presented by a corporate TLS-terminating proxy) when reporting over HTTPS. When unset, no flag is added.

# 2.1.0

* License
Expand Down
1 change: 1 addition & 0 deletions lib/scout_apm/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ defmodule ScoutApm.Application do
:core_agent_log_level,
:core_agent_log_file,
:core_agent_config_file,
:core_agent_ca_cert,
:errors_enabled,
:errors_host,
:logs_enabled,
Expand Down
1 change: 1 addition & 0 deletions lib/scout_apm/config/defaults.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ defmodule ScoutApm.Config.Defaults do
core_agent_download: true,
core_agent_launch: true,
core_agent_version: "v1.5.1",
core_agent_ca_cert: nil,
core_agent_tcp_ip: {127, 0, 0, 1},
core_agent_tcp_port: 9000,
collector_module: ScoutApm.Core.AgentManager,
Expand Down
12 changes: 12 additions & 0 deletions lib/scout_apm/core/agent_manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ defmodule ScoutApm.Core.AgentManager do
|> maybe_add_log_level()
|> maybe_add_log_file()
|> maybe_add_config_file()
|> maybe_add_ca_cert()

ScoutApm.Logger.log(:debug, "Starting Core Agent: #{bin_path} #{Enum.join(args, " ")}")

Expand Down Expand Up @@ -718,4 +719,15 @@ defmodule ScoutApm.Core.AgentManager do
args ++ ["--config-file", expanded_path]
end
end

@spec maybe_add_ca_cert(list(String.t())) :: list(String.t())
defp maybe_add_ca_cert(args) do
case ScoutApm.Config.find(:core_agent_ca_cert) do
nil ->
args

path when is_binary(path) ->
args ++ ["--ca-cert", path]
end
end
end
Loading