forked from locka99/opcua
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add extra debug to tasks ending. Fix hostname resolution. Fix 5 minut…
…e timer on server registration causing abort to timeout. Fix issue with server complaining on secure channel renew complaining when None security channel renews itself with a null nonce.
- Loading branch information
Showing
20 changed files
with
173 additions
and
78 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,39 @@ | ||
use opcua_types::service_types::RegisteredServer; | ||
|
||
use opcua_client::client::Client; | ||
use opcua_client::config::ClientConfig; | ||
|
||
use state::ServerState; | ||
|
||
/// Registers the specified endpoints with the specified discovery server | ||
pub fn register_discover_server(discovery_server_url: &str, server_state: &ServerState) { | ||
// This follows the local discovery process described in part 12 of the spec, calling | ||
// find_servers on it | ||
|
||
trace!("Discovery server registration stub is triggering for {}", discovery_server_url); | ||
pub fn register_with_discovery_server(discovery_server_url: &str, server_state: &ServerState) { | ||
debug!("register_with_discovery_server, for {}", discovery_server_url); | ||
let server_config = trace_read_lock_unwrap!(server_state.config); | ||
|
||
// Client's pki dir must match server's | ||
let mut config = ClientConfig::new("DiscoveryClient", "urn:DiscoveryClient"); | ||
config.pki_dir = server_config.pki_dir.clone(); | ||
let mut client = Client::new(config); | ||
|
||
let servers = client.find_servers(discovery_server_url); | ||
if let Ok(servers) = servers { | ||
debug!("Servers on the discovery endpoint - {:?}", servers); | ||
// This follows the local discovery process described in part 12 of the spec, calling | ||
// find_servers on it first. | ||
|
||
let registered_server: RegisteredServer = server_state.registered_server(); | ||
let result = client.register_server(discovery_server_url, registered_server); | ||
if result.is_err() { | ||
error!("Cannot register server with discovery server {}. Check for errors to discover the reason why.", discovery_server_url); | ||
error!("One solution you may try is to ensure your server's cert is trusted by the discovery server."); | ||
// Connect to the server and call find_servers to ensure it is a discovery server | ||
match client.find_servers(discovery_server_url) { | ||
Ok(servers) => { | ||
debug!("Servers on the discovery endpoint - {:?}", servers); | ||
// Register the server | ||
let registered_server = server_state.registered_server(); | ||
match client.register_server(discovery_server_url, registered_server) { | ||
Ok(_) => {} | ||
Err(err) => { | ||
error!("Cannot register server with discovery server {}. Check for error {:?} to discover the reason why.", discovery_server_url, err); | ||
error!("One solution you may try is to ensure your server's cert is trusted by the discovery server."); | ||
} | ||
} | ||
} | ||
Err(err) => { | ||
error!("Cannot find servers on discovery url {}, error = {:?}", discovery_server_url, err); | ||
} | ||
} | ||
|
||
debug!("register_with_discovery_server, finished"); | ||
} |
Oops, something went wrong.