Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to skip domain name verification of servers #527

Conversation

Fritiofhedstrom
Copy link
Contributor

#513

Add option "server_name_verification": Option. If set to true (default) servers' certificates must use their IP address or domain name as a common name in their ca-signed certificate in order to connect. If set to false then the servers will be trusted regardless of their common name, this is useful if the IP address of a Zenoh server is difficult to know in advance

Some small fixes on docs for zenoh-cfg-properties that were wrong.

@Fritiofhedstrom Fritiofhedstrom changed the title Skip domain name verification of servers Option to skip domain name verification of servers Aug 2, 2023
@Mallets Mallets requested review from p-avital and milyin and removed request for p-avital August 3, 2023 07:57
@Mallets
Copy link
Member

Mallets commented Aug 3, 2023

Thanks @Fritiofhedstrom for your PR! We need you to sign the Eclipse Contribution Agreement to be able to merge it.

In the meanwhile, I've requested @milyin to review the PR.

@Fritiofhedstrom Fritiofhedstrom force-pushed the skip_domain_name_verification_of_servers branch 3 times, most recently from f9d07b2 to d1b4c0f Compare August 4, 2023 11:08
Copy link
Contributor

@p-avital p-avital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have some clippy warnings to fix (seems to be your update of rustls surfaced some deprecations) :)

@@ -99,6 +101,12 @@ impl ConfigurationInspector<Config> for TlsConfigurator {
tls_client_certificate.into(),
);
}
if let Some(server_name_verification) = c.server_name_verification() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could shorten this to

match c.server_name_verification() {
    Some(true) | None => todo!("insert true"),
    Some(false) => todo!("insert false"),
}

Comment on lines 607 to 610
let server_name_verification: bool =
if let Some(value) = config.get(TLS_SERVER_NAME_VERIFICATION) {
value
} else {
TLS_SERVER_NAME_VERIFICATION_DEFAULT
}
.parse()?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be written more shortly:

let server_name_verification: bool = config.get(TLS_SERVER_NAME_VERIFICATION)
  .unwrap_or(TLS_SERVER_NAME_VERIFICATION_DEFAULT).parse()?;

@Fritiofhedstrom Fritiofhedstrom force-pushed the skip_domain_name_verification_of_servers branch from d1b4c0f to f84d7a6 Compare August 7, 2023 10:52
@Mallets
Copy link
Member

Mallets commented Aug 7, 2023

Please run cargo fmt --all to make the CI happy about the code format.

@Fritiofhedstrom Fritiofhedstrom force-pushed the skip_domain_name_verification_of_servers branch from f84d7a6 to 6701e05 Compare August 7, 2023 21:11
@Fritiofhedstrom Fritiofhedstrom force-pushed the skip_domain_name_verification_of_servers branch from 6701e05 to 32cd3ec Compare August 7, 2023 21:13
@Mallets Mallets merged commit 2a08f1a into eclipse-zenoh:master Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants