mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-17 13:46:27 -05:00
fix: support custom VPN ports on 2.3.x
This commit is contained in:
2 files changed
+14
-1
No files matched your search
@@ -75,7 +75,7 @@ int vpn_connect(const vpn_options *options, vpn_connected_callback callback)
|
||||
openconnect_set_loglevel(vpninfo, PRG_TRACE);
|
||||
openconnect_init_ssl();
|
||||
openconnect_set_protocol(vpninfo, "gp");
|
||||
openconnect_set_hostname(vpninfo, options->server);
|
||||
openconnect_parse_url(vpninfo, options->server);
|
||||
openconnect_set_cookie(vpninfo, options->cookie);
|
||||
|
||||
if (options->os) {
|
||||
|
||||
@@ -258,3 +258,16 @@ impl VpnBuilder {
|
||||
CString::new(value.to_string()).expect("Failed to convert to CString")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::Vpn;
|
||||
|
||||
#[test]
|
||||
fn vpn_builder_preserves_raw_host_and_custom_port() {
|
||||
let builder = Vpn::builder("vpn.example.com:4443", "cookie");
|
||||
|
||||
assert_eq!(builder.server, "vpn.example.com:4443");
|
||||
assert_eq!(builder.cookie, "cookie");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user