File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -551,9 +551,14 @@ impl ClientBuilder {
551
551
} ) ;
552
552
}
553
553
554
+ if versions. is_empty ( ) {
555
+ return Err ( crate :: error:: builder ( "empty supported tls versions" ) ) ;
556
+ }
557
+
554
558
// Build TLS config
555
559
let config_builder =
556
- rustls:: ClientConfig :: builder ( ) . with_root_certificates ( root_cert_store) ;
560
+ rustls:: ClientConfig :: builder_with_protocol_versions ( & versions)
561
+ . with_root_certificates ( root_cert_store) ;
557
562
558
563
// Finalize TLS config
559
564
let mut tls = if let Some ( id) = config. identity {
@@ -1475,6 +1480,9 @@ impl ClientBuilder {
1475
1480
/// isn't supported, just that it can't be set as a maximum due to
1476
1481
/// technical limitations.
1477
1482
///
1483
+ /// Cannot set a maximum outside the protocol versions supported by
1484
+ /// `rustls` with the `rustls-tls` backend.
1485
+ ///
1478
1486
/// # Optional
1479
1487
///
1480
1488
/// This requires the optional `default-tls`, `native-tls`, or `rustls-tls(-...)`
You can’t perform that action at this time.
0 commit comments