Skip to content

Commit

Permalink
Expose SSL_get_max_proto_version
Browse files Browse the repository at this point in the history
  • Loading branch information
rushilmehra committed Jun 18, 2024
1 parent a24e642 commit ee0fce1
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion boring/src/ssl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@ impl SslContextBuilder {
///
/// This corresponds to [`SSL_CTX_get_max_proto_version`].
///
/// [`SSL_CTX_get_max_proto_version`]: https://www.openssl.org/docs/man1.1.0/ssl/SSL_set_min_proto_version.html
/// [`SSL_CTX_get_max_proto_version`]: https://www.openssl.org/docs/man3.1/man3/SSL_CTX_get_max_proto_version.html
pub fn max_proto_version(&mut self) -> Option<SslVersion> {
unsafe {
let r = ffi::SSL_CTX_get_max_proto_version(self.as_ptr());
Expand Down Expand Up @@ -3168,6 +3168,23 @@ impl SslRef {
str::from_utf8(version.to_bytes()).unwrap()
}

/// Gets the maximum supported protocol version.
///
/// A value of `None` indicates that all versions down the the highest version supported by
/// OpenSSL are enabled.
///
/// This corresponds to [`SSL_get_max_proto_version`].
///
/// [`SSL_get_max_proto_version`]: https://www.openssl.org/docs/man3.1/man3/SSL_get_max_proto_version.html
pub fn max_proto_version(&self) -> Option<SslVersion> {
let r = unsafe { ffi::SSL_get_max_proto_version(self.as_ptr()) };
if r == 0 {
None
} else {
Some(SslVersion(r))
}
}

/// Returns the protocol selected via Application Layer Protocol Negotiation (ALPN).
///
/// The protocol's name is returned is an opaque sequence of bytes. It is up to the client
Expand Down

0 comments on commit ee0fce1

Please sign in to comment.