@@ -163,6 +163,13 @@ pub struct TlsConfig {
163163
164164 /// TLS ciphersuites to enable.
165165 pub ciphersuites : Option < String > ,
166+
167+ /// Elliptic curve groups to enable.
168+ ///
169+ /// Comma-separated list of supported elliptic curve groups (e.g., "P-256", "P-384", "P-521").
170+ /// Only available with OpenSSL 1.1.1+, BoringSSL, or LibreSSL 2.5.1+.
171+ #[ configurable( metadata( docs:: examples = "P-256,P-384" ) ) ]
172+ pub curves : Option < String > ,
166173}
167174
168175impl TlsConfig {
@@ -187,6 +194,7 @@ pub struct TlsSettings {
187194 server_name : Option < String > ,
188195 pub min_tls_version : Option < String > ,
189196 pub ciphersuites : Option < String > ,
197+ pub curves : Option < String > ,
190198}
191199
192200#[ derive( Clone ) ]
@@ -224,6 +232,7 @@ impl TlsSettings {
224232 server_name : options. server_name . clone ( ) ,
225233 min_tls_version : options. min_tls_version . clone ( ) ,
226234 ciphersuites : options. ciphersuites . clone ( ) ,
235+ curves : options. curves . clone ( ) ,
227236 } )
228237 }
229238
@@ -889,7 +898,7 @@ mod test {
889898 } ,
890899 ] ;
891900 for t in tests {
892- match builder. set_min_tls_version_and_ciphersuites ( & t. text , & None ) {
901+ match builder. set_min_tls_version_and_ciphersuites ( & t. text , & None , & None ) {
893902 Ok ( ( ) ) => {
894903 assert ! ( t. want. is_ok( ) ) ;
895904 assert_eq ! ( builder. min_proto_version( ) , t. num) ;
@@ -930,7 +939,7 @@ mod test {
930939 } ,
931940 ] ;
932941 for t in tests {
933- match builder. set_min_tls_version_and_ciphersuites ( & t. min_tls_version , & t. ciphersuite ) {
942+ match builder. set_min_tls_version_and_ciphersuites ( & t. min_tls_version , & t. ciphersuite , & None ) {
934943 Ok ( ( ) ) => assert ! ( t. want. is_ok( ) ) ,
935944 Err ( e) => assert_eq ! ( t. want. err( ) . unwrap( ) , e) ,
936945 }
0 commit comments