Allow returning the server name from the early callback

This commit is contained in:
Anthony Ramine 2021-04-13 11:59:27 +02:00
parent c4e1966c16
commit 6baba64eec
1 changed files with 9 additions and 0 deletions

View File

@ -1779,6 +1779,15 @@ impl ClientHello {
Some(slice::from_raw_parts(ptr, len)) 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_)
}
} }
/// Information about a cipher. /// Information about a cipher.