Skip to content

Commit 456836a

Browse files
abernardeau-wallixkornelski
authored andcommitted
Add boring specific api set_strict_cipher_list to SslContextBuilder
1 parent 76f47a7 commit 456836a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

boring/src/ssl/mod.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,27 @@ impl SslContextBuilder {
14741474
}
14751475
}
14761476

1477+
/// Sets the list of supported ciphers for protocols before TLSv1.3 but do not
1478+
/// tolerate anything meaningless in the cipher list.
1479+
///
1480+
/// The `set_ciphersuites` method controls the cipher suites for TLSv1.3 in OpenSSL.
1481+
/// BoringSSL doesn't implement `set_ciphersuites`.
1482+
/// See <https://github.com/google/boringssl/blob/main/include/openssl/ssl.h#L1685>
1483+
///
1484+
/// See [`ciphers`] for details on the format.
1485+
///
1486+
/// [`ciphers`]: <https://docs.openssl.org/master/man1/openssl-ciphers/>.
1487+
pub fn set_strict_cipher_list(&mut self, cipher_list: &str) -> Result<(), ErrorStack> {
1488+
let cipher_list = CString::new(cipher_list).unwrap();
1489+
unsafe {
1490+
cvt(ffi::SSL_CTX_set_strict_cipher_list(
1491+
self.as_ptr(),
1492+
cipher_list.as_ptr() as *const _,
1493+
))
1494+
.map(|_| ())
1495+
}
1496+
}
1497+
14771498
/// Gets the list of supported ciphers for protocols before TLSv1.3.
14781499
///
14791500
/// See [`ciphers`] for details on the format

0 commit comments

Comments
 (0)