aboutsummaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2019-11-21 15:41:43 -0500
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2019-11-22 10:51:17 +0900
commit931f3a07177691efcc3fd3c716ee647e20e38404 (patch)
tree447e2b30e6602e6ea57832d8e8cf302136d7b3ba /ext
parent7498a910d09f6a1299ddfa760ed45d1dee193f4c (diff)
downloadruby-openssl-931f3a07177691efcc3fd3c716ee647e20e38404.tar.gz
Update renegotiation_cb docstring to reflect its actual behavior in MRI
Closes #256
Diffstat (limited to 'ext')
-rw-r--r--ext/openssl/ossl_ssl.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index f31afba4..f709b655 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -2666,13 +2666,13 @@ Init_ossl_ssl(void)
rb_define_const(mSSLExtConfig, "HAVE_TLSEXT_HOST_NAME", Qtrue);
/*
- * A callback invoked whenever a new handshake is initiated. May be used
- * to disable renegotiation entirely.
+ * A callback invoked whenever a new handshake is initiated on an
+ * established connection. May be used to disable renegotiation entirely.
*
* The callback is invoked with the active SSLSocket. The callback's
- * return value is irrelevant, normal return indicates "approval" of the
+ * return value is ignored. A normal return indicates "approval" of the
* renegotiation and will continue the process. To forbid renegotiation
- * and to cancel the process, an Error may be raised within the callback.
+ * and to cancel the process, raise an exception within the callback.
*
* === Disable client renegotiation
*
@@ -2680,10 +2680,8 @@ Init_ossl_ssl(void)
* renegotiation entirely. You may use a callback as follows to implement
* this feature:
*
- * num_handshakes = 0
* ctx.renegotiation_cb = lambda do |ssl|
- * num_handshakes += 1
- * raise RuntimeError.new("Client renegotiation disabled") if num_handshakes > 1
+ * raise RuntimeError, "Client renegotiation disabled"
* end
*/
rb_attr(cSSLContext, rb_intern("renegotiation_cb"), 1, 1, Qfalse);