Class: HALEC
- Inherits:
-
Object
- Object
- HALEC
- Defined in:
- lib/rack/tctp/halec.rb
Overview
HTTP application layer encryption channel. Used for the Trusted Cloud Transfer Protocol (TCTP)
Direct Known Subclasses
Instance Attribute Summary collapse
-
#certificate ⇒ Object
readonly
A server or client certificate (if any).
-
#ctx ⇒ Object
readonly
The TLS context.
-
#private_key ⇒ Object
readonly
The private key for a certificate (if any).
-
#socket_here ⇒ Object
readonly
The plaintext socket.
-
#socket_there ⇒ Object
readonly
The encrypted socket.
-
#ssl_socket ⇒ Object
readonly
The SSL socket.
-
#url ⇒ Object
readonly
The URL of this HALEC.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ HALEC
constructor
A new instance of HALEC.
Constructor Details
#initialize(options = {}) ⇒ HALEC
Returns a new instance of HALEC.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rack/tctp/halec.rb', line 27 def initialize( = {}) @url = [:url] || '' @ctx = [:ssl_context] || OpenSSL::SSL::SSLContext.new() @ctx.ssl_version = :TLSv1 @socket_here, @socket_there = socket_pair [@socket_here, @socket_there].each do |socket| socket.set_encoding(Encoding::BINARY) end end |
Instance Attribute Details
#certificate ⇒ Object (readonly)
A server or client certificate (if any)
22 23 24 |
# File 'lib/rack/tctp/halec.rb', line 22 def certificate @certificate end |
#ctx ⇒ Object (readonly)
The TLS context
25 26 27 |
# File 'lib/rack/tctp/halec.rb', line 25 def ctx @ctx end |
#private_key ⇒ Object (readonly)
The private key for a certificate (if any)
19 20 21 |
# File 'lib/rack/tctp/halec.rb', line 19 def private_key @private_key end |
#socket_here ⇒ Object (readonly)
The plaintext socket
10 11 12 |
# File 'lib/rack/tctp/halec.rb', line 10 def socket_here @socket_here end |
#socket_there ⇒ Object (readonly)
The encrypted socket
16 17 18 |
# File 'lib/rack/tctp/halec.rb', line 16 def socket_there @socket_there end |
#ssl_socket ⇒ Object (readonly)
The SSL socket
13 14 15 |
# File 'lib/rack/tctp/halec.rb', line 13 def ssl_socket @ssl_socket end |
#url ⇒ Object (readonly)
The URL of this HALEC
7 8 9 |
# File 'lib/rack/tctp/halec.rb', line 7 def url @url end |