Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions python/rnet/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,11 @@ class ClientParams(TypedDict):
Verify SSL or specify CA path.
"""

verify_hostname: NotRequired[bool]
"""
Configures the use of hostname verification when connecting.
"""

identity: NotRequired[Identity]
"""
Represents a private key and X509 cert as a client certificate.
Expand Down
9 changes: 9 additions & 0 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ pub struct Builder {
// ========= TLS options =========
/// Whether to verify the SSL certificate or root certificate file path.
verify: Option<TlsVerify>,
/// Whether to verify the hostname in the SSL certificate.
verify_hostname: Option<bool>,
/// Represents a private key and X509 cert as a client certificate.
identity: Option<Identity>,
/// Key logging policy for TLS session keys.
Expand Down Expand Up @@ -203,6 +205,7 @@ impl<'py> FromPyObject<'py> for Builder {
extract_option!(ob, params, http2_options);

extract_option!(ob, params, verify);
extract_option!(ob, params, verify_hostname);
extract_option!(ob, params, identity);
extract_option!(ob, params, keylog);
extract_option!(ob, params, tls_info);
Expand Down Expand Up @@ -529,6 +532,12 @@ impl Client {
TlsVerify::CertificateStore(cert_store) => builder.cert_store(cert_store.0),
}
}
apply_option!(
set_if_some,
builder,
params.verify_hostname,
verify_hostname
);
apply_option!(set_if_some_inner, builder, params.identity, identity);
apply_option!(set_if_some_inner, builder, params.keylog, keylog);
apply_option!(set_if_some_inner, builder, params.tls_options, tls_options);
Expand Down
Loading