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 {
551551 } ) ;
552552 }
553553
554+ if versions. is_empty ( ) {
555+ return Err ( crate :: error:: builder ( "empty supported tls versions" ) ) ;
556+ }
557+
554558 // Build TLS config
555559 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) ;
557562
558563 // Finalize TLS config
559564 let mut tls = if let Some ( id) = config. identity {
@@ -1475,6 +1480,9 @@ impl ClientBuilder {
14751480 /// isn't supported, just that it can't be set as a maximum due to
14761481 /// technical limitations.
14771482 ///
1483+ /// Cannot set a maximum outside the protocol versions supported by
1484+ /// `rustls` with the `rustls-tls` backend.
1485+ ///
14781486 /// # Optional
14791487 ///
14801488 /// This requires the optional `default-tls`, `native-tls`, or `rustls-tls(-...)`
You can’t perform that action at this time.
0 commit comments