diff --git a/boring/src/ssl/mod.rs b/boring/src/ssl/mod.rs index a3bbc48f..7d0d5f89 100644 --- a/boring/src/ssl/mod.rs +++ b/boring/src/ssl/mod.rs @@ -1779,6 +1779,15 @@ 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_) + } } /// Information about a cipher.