Sha256: 75608fcac0d36d25bb55fb50f3b443c758e14c978cf07ad555a4626895ea704f

Contents?: true

Size: 813 Bytes

Versions: 43

Compression:

Stored size: 813 Bytes

Contents

#!/usr/bin/env ruby

$:.unshift(File.join(File.dirname(__FILE__), '..', '..'))

require 'test/unit'
require 'rex/socket/ssl_tcp'

class Rex::Socket::SslTcp::UnitTest < Test::Unit::TestCase

	def test_ssltcp

		# Create an SslTcp instance
		t = nil
		assert_nothing_raised {
			t = Rex::Socket::SslTcp.create(
				'PeerHost' => 'www.google.com',
				'PeerPort' => 443)
		}
		assert_kind_of(Rex::Socket::SslTcp, t, "valid ssl tcp")

		# Send a HEAD request and make sure we get some kind of response
		head_request = "HEAD / HTTP/1.0\r\n\r\n"

		assert_equal(19, t.put(head_request), "sending head request")

		head_response = ""

		assert_nothing_raised {
			head_response = t.get(nil) || ""
		}

		assert_match(/^HTTP\/1./, head_response, "valid head response")

		assert_nothing_raised {
			t.close
		}
	end

end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
librex-0.0.65 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.63 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.54 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.53 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.52 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.51 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.50 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.49 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.48 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.47 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.46 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.44 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.43 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.42 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.41 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.40 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.39 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.38 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.37 lib/rex/socket/ssl_tcp.rb.ut.rb
librex-0.0.36 lib/rex/socket/ssl_tcp.rb.ut.rb