Skip to content

Commit e92f2a6

Browse files
author
Guanqun Lu
committed
add another interface for backward compatibility
1 parent a6cd7db commit e92f2a6

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/easy/handle.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,8 +949,13 @@ impl Easy {
949949
}
950950

951951
/// Same as [`Easy2::ssl_version`](struct.Easy2.html#method.ssl_version)
952-
pub fn ssl_version(&mut self, min_version: SslVersion, max_version: SslVersion) -> Result<(), Error> {
953-
self.inner.ssl_version(min_version, max_version)
952+
pub fn ssl_version(&mut self, version: SslVersion) -> Result<(), Error> {
953+
self.inner.ssl_version(version)
954+
}
955+
956+
/// Same as [`Easy2::ssl_min_max_version`](struct.Easy2.html#method.ssl_min_max_version)
957+
pub fn ssl_min_max_version(&mut self, min_version: SslVersion, max_version: SslVersion) -> Result<(), Error> {
958+
self.inner.ssl_min_max_version(min_version, max_version)
954959
}
955960

956961
/// Same as [`Easy2::ssl_verify_host`](struct.Easy2.html#method.ssl_verify_host)

src/easy/handler.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,15 @@ impl<H> Easy2<H> {
19491949
///
19501950
/// By default this option is not set and corresponds to
19511951
/// `CURLOPT_SSLVERSION`.
1952-
pub fn ssl_version(&mut self, min_version: SslVersion, max_version: SslVersion) -> Result<(), Error> {
1952+
pub fn ssl_version(&mut self, version: SslVersion) -> Result<(), Error> {
1953+
self.setopt_long(curl_sys::CURLOPT_SSLVERSION, version as c_long)
1954+
}
1955+
1956+
/// Set preferred TLS/SSL version with minimum version and maximum version.
1957+
///
1958+
/// By default this option is not set and corresponds to
1959+
/// `CURLOPT_SSLVERSION`.
1960+
pub fn ssl_min_max_version(&mut self, min_version: SslVersion, max_version: SslVersion) -> Result<(), Error> {
19531961
let version = (min_version as c_long) | ((max_version as c_long) << 16);
19541962
self.setopt_long(curl_sys::CURLOPT_SSLVERSION, version)
19551963
}

0 commit comments

Comments
 (0)