pub fn get_anyconnect_protocol() -> Protocol
Examples found in repository?
examples/password_server.rs (line 13)
9fn main() -> Result<(), Box<dyn std::error::Error>> {
10 dotenvy::from_path(".env.local").unwrap();
11 env::set_var("OPENSSL_CONF", "/dev/null");
12
13 let protocol = get_anyconnect_protocol();
14
15 let config = ConfigBuilder::default().loglevel(LogLevel::Info).build()?;
16
17 let event_handlers = EventHandlers::default();
18
19 let client = VpnClient::new(config, event_handlers)?;
20
21 let entrypoint = EntrypointBuilder::new()
22 .server(&env::var("VPN_SERVER").unwrap())
23 .username(&env::var("VPN_USERNAME").unwrap())
24 .password(&env::var("VPN_PASSWORD").unwrap())
25 .protocol(protocol)
26 .enable_udp(true)
27 .accept_insecure_cert(true)
28 .build()?;
29
30 client.init_connection(entrypoint)?;
31 client.run_loop()?;
32
33 Ok(())
34}