lib/ronin/network/ssl.rb in ronin-support-0.5.0.rc2 vs lib/ronin/network/ssl.rb in ronin-support-0.5.0
- old
+ new
@@ -20,10 +20,11 @@
require 'ronin/network/tcp'
begin
require 'openssl'
rescue ::LoadError
+ $stderr.puts "WARNING: Ruby was not compiled with OpenSSL support"
end
module Ronin
module Network
#
@@ -97,10 +98,12 @@
# the new SSL Socket.
#
# @example
# socket = ssl_connect('twitter.com',443)
#
+ # @see http://rubydoc.info/stdlib/openssl/OpenSSL/SSL/SSLSocket
+ #
# @api public
#
def ssl_connect(host,port,options={})
local_host = options[:local_host]
local_port = options[:local_port]
@@ -163,13 +166,15 @@
#
# @return [nil]
#
# @example
# ssl_session('twitter.com',443) do |sock|
- # sock.write("GET /\n\n")
+ # sock.write("GET / HTTP/1.1\n\r\n\r")
#
# sock.each_line { |line| puts line }
# end
+ #
+ # @see http://rubydoc.info/stdlib/openssl/OpenSSL/SSL/SSLSocket
#
# @api public
#
def ssl_session(host,port,options={},&block)
ssl_socket = ssl_connect(host,port,options,&block)