pub(crate) fn create_agent(
tls_security: ConnectionSecurity,
max_idle_connections: Option<usize>,
timeout_seconds: Option<u64>,
) -> Result<Agent, Error>Expand description
Creates an [Agent] for the use in a NetHsm connection.
Takes a ConnectionSecurity to define the TLS security model for the connection.
Allows setting the maximum idle connections per host using the optional
max_idle_connections (defaults to available_parallelism and falls back to
DEFAULT_MAX_IDLE_CONNECTIONS if unavailable).
Also allows setting the timeout in seconds for a successful socket connection
using the optional timeout_seconds (defaults to DEFAULT_TIMEOUT_SECONDS).
ยงErrors
Returns an error if
- the TLS client configuration can not be created,
ConnectionSecurity::Nativeis provided astls_security, but no certification authority certificates are available on the system.