pub struct WinrmConfig {Show 17 fields
pub port: u16,
pub use_tls: bool,
pub accept_invalid_certs: bool,
pub connect_timeout_secs: u64,
pub operation_timeout_secs: u64,
pub auth_method: AuthMethod,
pub max_envelope_size: u32,
pub max_retries: u32,
pub client_cert_pem: Option<String>,
pub client_key_pem: Option<String>,
pub proxy: Option<String>,
pub codepage: u32,
pub working_directory: Option<String>,
pub env_vars: Vec<(String, String)>,
pub encryption: EncryptionMode,
pub user_agent: Option<String>,
pub idle_timeout_secs: Option<u64>,
}Expand description
Configuration for a WinrmClient connection.
Controls the transport (HTTP vs HTTPS), timeouts, and authentication
method. Use Default::default() for sensible defaults (HTTP on port
5985, NTLM auth, 30 s connect / 60 s operation timeouts).
Fields§
§port: u16TCP port of the WinRM listener (default: 5985 for HTTP, 5986 for HTTPS).
use_tls: boolWhether to connect over HTTPS. When true, the endpoint URL uses https://.
accept_invalid_certs: boolAccept invalid or self-signed TLS certificates. Use only in test environments.
connect_timeout_secs: u64TCP connect timeout in seconds (default: 30).
operation_timeout_secs: u64WS-Management OperationTimeout in seconds (default: 60). The HTTP
client timeout is set to this value plus 10 seconds to allow the server
to respond before the transport gives up.
auth_method: AuthMethodAuthentication method to use for all requests (default: AuthMethod::Ntlm).
max_envelope_size: u32Maximum SOAP envelope size in bytes (default: 153600).
Controls the MaxEnvelopeSize header sent in every WS-Management request.
Increase this for hosts that return large responses.
max_retries: u32Maximum number of retries for transient HTTP errors (default: 0 = no retry).
Uses exponential backoff starting at 100 ms (100, 200, 400, …).
Only WinrmError::Http errors trigger a retry; authentication and
SOAP faults are returned immediately.
client_cert_pem: Option<String>Path to client certificate PEM file (for AuthMethod::Certificate).
client_key_pem: Option<String>Path to client private key PEM file (for AuthMethod::Certificate).
proxy: Option<String>HTTP proxy URL (e.g. "http://proxy:8080").
When set, all WinRM HTTP(S) requests are routed through this proxy.
codepage: u32Console output code page (default: 65001 = UTF-8).
Controls the WINRS_CODEPAGE option in the shell creation envelope.
Common values: 65001 (UTF-8), 437 (US), 850 (Western European).
working_directory: Option<String>Initial working directory for the remote shell (default: None).
When set, the shell starts in this directory. Equivalent to running
cd <path> before any command.
env_vars: Vec<(String, String)>Environment variables to set in the remote shell (default: empty).
Each (key, value) pair is injected into the shell’s environment
at creation time via <rsp:Environment>.
encryption: EncryptionModeMessage encryption mode for NTLM (default: EncryptionMode::Auto).
Controls whether NTLM sealing is applied to SOAP message bodies.
user_agent: Option<String>Custom HTTP User-Agent header (default: None = winrm-rs/<version>).
idle_timeout_secs: Option<u64>Shell idle timeout in seconds (default: None = server default).
When set, the shell will be automatically closed by the server after this many seconds of inactivity.
Trait Implementations§
Source§impl Clone for WinrmConfig
impl Clone for WinrmConfig
Source§fn clone(&self) -> WinrmConfig
fn clone(&self) -> WinrmConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more