diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2017-08-23 13:21:41 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2017-08-24 21:01:09 +0900 |
commit | 36dc23f65026e4374851aae511b0ff3a39143dfe (patch) | |
tree | d6b462cc12c3d0faa838fa9570bed03f816d00e5 /test | |
parent | 94f62a7de6ebdeb7c99e7e1b313872c03a84712a (diff) | |
download | ruby-openssl-36dc23f65026e4374851aae511b0ff3a39143dfe.tar.gz |
test/utils: add SSLTestCase#tls12_supported?
Add a method that returns whether the OpenSSL supports TLS 1.2 or not.
This will be useful for test cases that are specific to TLS ~1.2.
Diffstat (limited to 'test')
-rw-r--r-- | test/utils.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/utils.rb b/test/utils.rb index a672b916..0bcdf3f7 100644 --- a/test/utils.rb +++ b/test/utils.rb @@ -168,6 +168,10 @@ class OpenSSL::SSLTestCase < OpenSSL::TestCase @server = nil end + def tls12_supported? + OpenSSL::SSL::SSLContext::METHODS.include?(:TLSv1_2) + end + def readwrite_loop(ctx, ssl) while line = ssl.gets ssl.write(line) |