@@ -41,7 +41,9 @@ const CONTENT_TYPE_HANDSHAKE: u8 = 22;
4141/// TLS `HandshakeType` for `ClientHello`.
4242const HANDSHAKE_TYPE_CLIENT_HELLO : u8 = 1 ;
4343
44- /// TLS extension type for Server Name Indication (RFC 6066).
44+ /// TLS extension type for Server Name Indication ([RFC 6066]).
45+ ///
46+ /// [RFC 6066]: https://datatracker.ietf.org/doc/html/rfc6066
4547const EXTENSION_TYPE_SNI : u16 = 0 ;
4648
4749/// SNI `NameType` for DNS hostnames.
@@ -111,11 +113,15 @@ pub enum SniParseError {
111113 #[ error( "malformed TLS extension" ) ]
112114 MalformedExtension ,
113115
114- /// The SNI hostname is empty (RFC 6066 requires a valid DNS name).
116+ /// The SNI hostname is empty ([RFC 6066] requires a valid DNS name).
117+ ///
118+ /// [RFC 6066]: https://datatracker.ietf.org/doc/html/rfc6066
115119 #[ error( "SNI hostname must not be empty (RFC 6066)" ) ]
116120 EmptyHostname ,
117121
118- /// The SNI hostname is an IP literal (rejected per RFC 6066 section 3).
122+ /// The SNI hostname is an IP literal (rejected per [RFC 6066 Section 3]).
123+ ///
124+ /// [RFC 6066 Section 3]: https://datatracker.ietf.org/doc/html/rfc6066#section-3
119125 #[ error( "SNI must not be an IP address (RFC 6066)" ) ]
120126 InvalidHostname ,
121127}
@@ -338,7 +344,9 @@ fn read_u24(data: &[u8], offset: usize) -> Result<u32, SniParseError> {
338344// Validation
339345// ---------------------------------------------------------------------------------
340346
341- /// Reject IP address literals per RFC 6066 section 3.
347+ /// Reject IP address literals per [RFC 6066 Section 3].
348+ ///
349+ /// [RFC 6066 Section 3]: https://datatracker.ietf.org/doc/html/rfc6066#section-3
342350fn reject_ip_literal ( hostname : & str ) -> Result < ( ) , SniParseError > {
343351 if hostname. parse :: < std:: net:: IpAddr > ( ) . is_ok ( ) {
344352 return Err ( SniParseError :: InvalidHostname ) ;
0 commit comments