aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/ssl/mod.rs
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2015-09-16 11:51:45 -0700
committerSteven Fackler <[email protected]>2015-09-16 11:51:45 -0700
commitb1b76f7913cafac909ac7a5fc42e889d0731ace0 (patch)
treec6c4a67e57b2835218cb72e18190cff14097bfc0 /openssl/src/ssl/mod.rs
parentMerge pull request #261 from jedisct1/try_ssl_null (diff)
parentssl/alpn: test mismatch between protocols resulting in None (diff)
downloadrust-openssl-b1b76f7913cafac909ac7a5fc42e889d0731ace0.tar.xz
rust-openssl-b1b76f7913cafac909ac7a5fc42e889d0731ace0.zip
Merge pull request #266 from jmesmon/alpn
ssl/npn+alpn: adjust protocol selection to fail if no protocols match
Diffstat (limited to 'openssl/src/ssl/mod.rs')
-rw-r--r--openssl/src/ssl/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs
index 20c9234c..3adf89e6 100644
--- a/openssl/src/ssl/mod.rs
+++ b/openssl/src/ssl/mod.rs
@@ -308,8 +308,11 @@ unsafe fn select_proto_using(ssl: *mut ffi::SSL,
let client_len = protocols.len() as c_uint;
// Finally, let OpenSSL find a protocol to be used, by matching the given server and
// client lists.
- ffi::SSL_select_next_proto(out, outlen, inbuf, inlen, client, client_len);
- ffi::SSL_TLSEXT_ERR_OK
+ if ffi::SSL_select_next_proto(out, outlen, inbuf, inlen, client, client_len) != ffi::OPENSSL_NPN_NEGOTIATED {
+ ffi::SSL_TLSEXT_ERR_NOACK
+ } else {
+ ffi::SSL_TLSEXT_ERR_OK
+ }
}
/// The function is given as the callback to `SSL_CTX_set_next_proto_select_cb`.