aboutsummaryrefslogtreecommitdiff
path: root/openssl/src
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2016-05-01 21:02:29 -0700
committerSteven Fackler <[email protected]>2016-05-03 20:24:07 -0700
commit696b1961ce31e77aebf5fcf13398c8c54ed22d87 (patch)
tree488a5dfb065cb8ebb472b5f6e7a10c82a9e4874d /openssl/src
parentAdjust set_ssl_context API (diff)
downloadrust-openssl-696b1961ce31e77aebf5fcf13398c8c54ed22d87.tar.xz
rust-openssl-696b1961ce31e77aebf5fcf13398c8c54ed22d87.zip
Rename getters in line with conventions
Diffstat (limited to 'openssl/src')
-rw-r--r--openssl/src/ssl/mod.rs16
-rw-r--r--openssl/src/ssl/tests/mod.rs4
2 files changed, 9 insertions, 11 deletions
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs
index 55a97c94..1bb4a2d8 100644
--- a/openssl/src/ssl/mod.rs
+++ b/openssl/src/ssl/mod.rs
@@ -767,7 +767,7 @@ impl SslContext {
SslContextOptions::from_bits(ret).unwrap()
}
- pub fn get_options(&mut self) -> SslContextOptions {
+ pub fn options(&mut self) -> SslContextOptions {
let ret = unsafe { ffi_extras::SSL_CTX_get_options(self.ctx) };
SslContextOptions::from_bits(ret).unwrap()
}
@@ -982,7 +982,7 @@ impl Ssl {
}
}
- pub fn get_current_cipher<'a>(&'a self) -> Option<SslCipher<'a>> {
+ pub fn current_cipher<'a>(&'a self) -> Option<SslCipher<'a>> {
unsafe {
let ptr = ffi::SSL_get_current_cipher(self.ssl);
@@ -1119,7 +1119,7 @@ impl Ssl {
Some(s)
}
- pub fn get_ssl_method(&self) -> Option<SslMethod> {
+ pub fn ssl_method(&self) -> Option<SslMethod> {
unsafe {
let method = ffi::SSL_get_ssl_method(self.ssl);
SslMethod::from_raw(method)
@@ -1127,7 +1127,7 @@ impl Ssl {
}
/// Returns the server's name for the current connection
- pub fn get_servername(&self) -> Option<String> {
+ pub fn servername(&self) -> Option<String> {
let name = unsafe { ffi::SSL_get_servername(self.ssl, ffi::TLSEXT_NAMETYPE_host_name) };
if name == ptr::null() {
return None;
@@ -1136,9 +1136,7 @@ impl Ssl {
unsafe { String::from_utf8(CStr::from_ptr(name as *const _).to_bytes().to_vec()).ok() }
}
- /// change the context corresponding to the current connection
- ///
- /// Returns a clone of the SslContext @ctx (ie: the new context). The old context is freed.
+ /// Changes the context corresponding to the current connection.
pub fn set_ssl_context(&self, ctx: &SslContext) -> Result<(), ErrorStack> {
unsafe {
try_ssl_null!(ffi::SSL_set_SSL_CTX(self.ssl, ctx.ctx));
@@ -1146,8 +1144,8 @@ impl Ssl {
Ok(())
}
- /// obtain the context corresponding to the current connection
- pub fn get_ssl_context(&self) -> SslContext {
+ /// Returns the context corresponding to the current connection
+ pub fn ssl_context(&self) -> SslContext {
unsafe {
let ssl_ctx = ffi::SSL_get_SSL_CTX(self.ssl);
SslContext::new_ref(ssl_ctx)
diff --git a/openssl/src/ssl/tests/mod.rs b/openssl/src/ssl/tests/mod.rs
index 7f0f3415..e3b0a340 100644
--- a/openssl/src/ssl/tests/mod.rs
+++ b/openssl/src/ssl/tests/mod.rs
@@ -227,7 +227,7 @@ run_test!(new_sslstream, |method, stream| {
run_test!(get_ssl_method, |method, _| {
let ssl = Ssl::new(&SslContext::new(method).unwrap()).unwrap();
- assert_eq!(ssl.get_ssl_method(), Some(method));
+ assert_eq!(ssl.ssl_method(), Some(method));
});
run_test!(verify_untrusted, |method, stream| {
@@ -462,7 +462,7 @@ fn test_set_certificate_and_private_key() {
run_test!(get_ctx_options, |method, _| {
let mut ctx = SslContext::new(method).unwrap();
- ctx.get_options();
+ ctx.options();
});
run_test!(set_ctx_options, |method, _| {