summaryrefslogtreecommitdiffstats
path: root/test/utils.rb
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-12-04 21:56:06 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-12-05 00:32:47 +0900
commitb7a15b7f3f861fe3e58c1e75299cfd154e037c5b (patch)
treeeb23640452742cfa17a14c76b94495b713ea3aaa /test/utils.rb
parent182604c8c35a7ae7bbf097f7d8b8d2eacc817f2c (diff)
downloadruby-openssl-b7a15b7f3f861fe3e58c1e75299cfd154e037c5b.tar.gz
ssl: prevent encoded NPN advertised protocol list from being GCed
SSLContext#setup encodes the protocol list set in @npn_protocols into a String. The String is passed to SSL_CTX_set_next_protos_advertised_cb() and OpenSSL invokes the callback function with the String. However since Ruby's GC can't find the reference to the String from the inside of OpenSSL, it can be free'd before the callback is invoked. So store the String in an instance variable to prevent this.
Diffstat (limited to 'test/utils.rb')
0 files changed, 0 insertions, 0 deletions