about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-12-21 03:58:19 +0000
committerEric Wong <e@80x24.org>2014-12-21 07:42:03 +0000
commitb2972ad560979f96ca9fb94e4ee5f8e80d3ae58a (patch)
tree8aee230c50db28e5583b682349bb95ca6654a65b /test
parent194de24ef934cf2d21820b36206ac0f81e4738d6 (diff)
downloadyahns-b2972ad560979f96ca9fb94e4ee5f8e80d3ae58a.tar.gz
We'll be writing more SSL-related tests in the future...
Diffstat (limited to 'test')
-rw-r--r--test/test_ssl.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/test_ssl.rb b/test/test_ssl.rb
index 2ed601c..13c14f0 100644
--- a/test/test_ssl.rb
+++ b/test/test_ssl.rb
@@ -53,13 +53,16 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
     ssl
   end
 
-  def test_ssl_basic
-    err, cfg, host, port = @err, Yahns::Config.new, @srv.addr[3], @srv.addr[1]
-    host, port = @srv.addr[3], @srv.addr[1]
+  def srv_ctx
     ctx = OpenSSL::SSL::SSLContext.new
     ctx.ciphers = "ADH"
     ctx.tmp_dh_callback = proc { TEST_KEY_DH1024 }
+    ctx
+  end
 
+  def test_ssl_basic
+    err, cfg, host, port = @err, Yahns::Config.new, @srv.addr[3], @srv.addr[1]
+    ctx = srv_ctx
     pid = mkserver(cfg) do
       cfg.instance_eval do
         ru = lambda { |_| [ 200, {'Content-Length'=>'2'}, ['HI'] ] }