Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions boring/src/ssl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,27 @@ impl SslContextBuilder {
}
}

/// Sets the list of supported ciphers for protocols before TLSv1.3 but do not
/// tolerate anything meaningless in the cipher list.
///
/// The `set_ciphersuites` method controls the cipher suites for TLSv1.3 in OpenSSL.
/// BoringSSL doesn't implement `set_ciphersuites`.
/// See <https://github.com/google/boringssl/blob/main/include/openssl/ssl.h#L1685>
///
/// See [`ciphers`] for details on the format.
///
/// [`ciphers`]: <https://docs.openssl.org/master/man1/openssl-ciphers/>.
pub fn set_strict_cipher_list(&mut self, cipher_list: &str) -> Result<(), ErrorStack> {
let cipher_list = CString::new(cipher_list).unwrap();
unsafe {
cvt(ffi::SSL_CTX_set_strict_cipher_list(
self.as_ptr(),
cipher_list.as_ptr() as *const _,
))
.map(|_| ())
}
}

/// Gets the list of supported ciphers for protocols before TLSv1.3.
///
/// See [`ciphers`] for details on the format
Expand Down