@@ -654,8 +654,8 @@ impl SslVersion {
654654
655655 /// TLSv1.3
656656 ///
657- /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
658- #[ cfg( any( ossl111, libressl340) ) ]
657+ /// Requires BoringSSL or OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
658+ #[ cfg( any( ossl111, libressl340, boringssl ) ) ]
659659 pub const TLS1_3 : SslVersion = SslVersion ( ffi:: TLS1_3_VERSION ) ;
660660
661661 /// DTLSv1.0
@@ -666,7 +666,7 @@ impl SslVersion {
666666 /// DTLSv1.2
667667 ///
668668 /// DTLS 1.2 corresponds to TLS 1.2 to harmonize versions. There was never a DTLS 1.1.
669- #[ cfg( any( ossl102, libressl332) ) ]
669+ #[ cfg( any( ossl102, libressl332, boringssl ) ) ]
670670 pub const DTLS1_2 : SslVersion = SslVersion ( ffi:: DTLS1_2_VERSION ) ;
671671}
672672
@@ -1147,9 +1147,9 @@ impl SslContextBuilder {
11471147 /// A value of `None` will enable protocol versions down to the lowest version supported by
11481148 /// OpenSSL.
11491149 ///
1150- /// Requires OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer.
1150+ /// Requires BoringSSL or OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer.
11511151 #[ corresponds( SSL_CTX_set_min_proto_version ) ]
1152- #[ cfg( any( ossl110, libressl261) ) ]
1152+ #[ cfg( any( ossl110, libressl261, boringssl ) ) ]
11531153 pub fn set_min_proto_version ( & mut self , version : Option < SslVersion > ) -> Result < ( ) , ErrorStack > {
11541154 unsafe {
11551155 cvt ( ffi:: SSL_CTX_set_min_proto_version (
@@ -1165,9 +1165,9 @@ impl SslContextBuilder {
11651165 /// A value of `None` will enable protocol versions up to the highest version supported by
11661166 /// OpenSSL.
11671167 ///
1168- /// Requires OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer.
1168+ /// Requires BoringSSL or OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer.
11691169 #[ corresponds( SSL_CTX_set_max_proto_version ) ]
1170- #[ cfg( any( ossl110, libressl261) ) ]
1170+ #[ cfg( any( ossl110, libressl261, boringssl ) ) ]
11711171 pub fn set_max_proto_version ( & mut self , version : Option < SslVersion > ) -> Result < ( ) , ErrorStack > {
11721172 unsafe {
11731173 cvt ( ffi:: SSL_CTX_set_max_proto_version (
@@ -1223,16 +1223,16 @@ impl SslContextBuilder {
12231223 /// and `http/1.1` is encoded as `b"\x06spdy/1\x08http/1.1"`. The protocols are ordered by
12241224 /// preference.
12251225 ///
1226- /// Requires OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
1226+ /// Requires BoringSSL or OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
12271227 #[ corresponds( SSL_CTX_set_alpn_protos ) ]
1228- #[ cfg( any( ossl102, libressl261) ) ]
1228+ #[ cfg( any( ossl102, libressl261, boringssl ) ) ]
12291229 pub fn set_alpn_protos ( & mut self , protocols : & [ u8 ] ) -> Result < ( ) , ErrorStack > {
12301230 unsafe {
12311231 assert ! ( protocols. len( ) <= c_uint:: max_value( ) as usize ) ;
12321232 let r = ffi:: SSL_CTX_set_alpn_protos (
12331233 self . as_ptr ( ) ,
12341234 protocols. as_ptr ( ) ,
1235- protocols. len ( ) as c_uint ,
1235+ protocols. len ( ) as _ ,
12361236 ) ;
12371237 // fun fact, SSL_CTX_set_alpn_protos has a reversed return code D:
12381238 if r == 0 {
@@ -2480,19 +2480,16 @@ impl SslRef {
24802480
24812481 /// Like [`SslContextBuilder::set_alpn_protos`].
24822482 ///
2483- /// Requires OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
2483+ /// Requires BoringSSL or OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
24842484 ///
24852485 /// [`SslContextBuilder::set_alpn_protos`]: struct.SslContextBuilder.html#method.set_alpn_protos
24862486 #[ corresponds( SSL_set_alpn_protos ) ]
2487- #[ cfg( any( ossl102, libressl261) ) ]
2487+ #[ cfg( any( ossl102, libressl261, boringssl ) ) ]
24882488 pub fn set_alpn_protos ( & mut self , protocols : & [ u8 ] ) -> Result < ( ) , ErrorStack > {
24892489 unsafe {
24902490 assert ! ( protocols. len( ) <= c_uint:: max_value( ) as usize ) ;
2491- let r = ffi:: SSL_set_alpn_protos (
2492- self . as_ptr ( ) ,
2493- protocols. as_ptr ( ) ,
2494- protocols. len ( ) as c_uint ,
2495- ) ;
2491+ let r =
2492+ ffi:: SSL_set_alpn_protos ( self . as_ptr ( ) , protocols. as_ptr ( ) , protocols. len ( ) as _ ) ;
24962493 // fun fact, SSL_set_alpn_protos has a reversed return code D:
24972494 if r == 0 {
24982495 Ok ( ( ) )
@@ -2639,9 +2636,9 @@ impl SslRef {
26392636 /// The protocol's name is returned is an opaque sequence of bytes. It is up to the client
26402637 /// to interpret it.
26412638 ///
2642- /// Requires OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
2639+ /// Requires BoringSSL or OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
26432640 #[ corresponds( SSL_get0_alpn_selected ) ]
2644- #[ cfg( any( ossl102, libressl261) ) ]
2641+ #[ cfg( any( ossl102, libressl261, boringssl ) ) ]
26452642 pub fn selected_alpn_protocol ( & self ) -> Option < & [ u8 ] > {
26462643 unsafe {
26472644 let mut data: * const c_uchar = ptr:: null ( ) ;
@@ -3334,9 +3331,9 @@ impl SslRef {
33343331 /// A value of `None` will enable protocol versions down to the lowest version supported by
33353332 /// OpenSSL.
33363333 ///
3337- /// Requires OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer.
3334+ /// Requires BoringSSL or OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer.
33383335 #[ corresponds( SSL_set_min_proto_version ) ]
3339- #[ cfg( any( ossl110, libressl261) ) ]
3336+ #[ cfg( any( ossl110, libressl261, boringssl ) ) ]
33403337 pub fn set_min_proto_version ( & mut self , version : Option < SslVersion > ) -> Result < ( ) , ErrorStack > {
33413338 unsafe {
33423339 cvt ( ffi:: SSL_set_min_proto_version (
@@ -3352,9 +3349,9 @@ impl SslRef {
33523349 /// A value of `None` will enable protocol versions up to the highest version supported by
33533350 /// OpenSSL.
33543351 ///
3355- /// Requires OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer.
3352+ /// Requires BoringSSL or OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer.
33563353 #[ corresponds( SSL_set_max_proto_version ) ]
3357- #[ cfg( any( ossl110, libressl261) ) ]
3354+ #[ cfg( any( ossl110, libressl261, boringssl ) ) ]
33583355 pub fn set_max_proto_version ( & mut self , version : Option < SslVersion > ) -> Result < ( ) , ErrorStack > {
33593356 unsafe {
33603357 cvt ( ffi:: SSL_set_max_proto_version (
0 commit comments