Merge pull request #28 from nox/early-servername

Allow returning more stuff from the early callback
This commit is contained in:
Ivan Nikulin 2021-04-13 12:21:26 +01:00 committed by GitHub
commit 10e472f64a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -1779,6 +1779,20 @@ impl ClientHello {
Some(slice::from_raw_parts(ptr, len))
}
}
fn ssl(&self) -> &SslRef {
unsafe { SslRef::from_ptr(self.0.ssl) }
}
/// Returns the servername sent by the client via Server Name Indication (SNI).
pub fn servername(&self, type_: NameType) -> Option<&str> {
self.ssl().servername(type_)
}
/// Returns a string describing the protocol version of the session.
pub fn version_str(&self) -> &'static str {
self.ssl().version_str()
}
}
/// Information about a cipher.