Skip to content

Commit

Permalink
docs(client): correct comment about tls::Context.domain's usage
Browse files Browse the repository at this point in the history
  • Loading branch information
compressed committed Jan 27, 2017
1 parent 9f358a8 commit f0dd32e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ pub mod tls {
}

impl Context {
/// Try to construct a new `Context`, providing the domain the client will
/// connect to.
/// Try to construct a new `Context`.
///
/// The provided domain will be used for both
/// [SNI](https://en.wikipedia.org/wiki/Server_Name_Indication) and certificate hostname
/// validation.
pub fn new<S: Into<String>>(domain: S) -> Result<Self, ::tls::NativeTlsError> {
Ok(Context {
domain: domain.into(),
Expand All @@ -48,6 +51,10 @@ pub mod tls {
}

/// Construct a new `Context` using the provided domain and `TlsConnector`
///
/// The domain will be used for both
/// [SNI](https://en.wikipedia.org/wiki/Server_Name_Indication) and certificate hostname
/// validation.
pub fn from_connector<S: Into<String>>(domain: S, tls_connector: TlsConnector) -> Self {
Context {
domain: domain.into(),
Expand Down

0 comments on commit f0dd32e

Please sign in to comment.