-
Notifications
You must be signed in to change notification settings - Fork 177
Closed
Description
I'm trying to set up a SSL socket over another SSL socket:
require 'net/http'
s = TCPSocket.open('127.0.0.1', 4433, nil, nil)
proxy_sock = OpenSSL::SSL::SSLSocket.new(s)
Net::Protocol.new.send(:ssl_socket_connect, proxy_sock, 1.0)
OpenSSL::SSL::SSLSocket.new(proxy_sock)
$ ruby tmp/minimal_example.rb
tmp/minimal_example.rb:7:in 'OpenSSL::SSL::SSLSocket#initialize': wrong argument type OpenSSL::SSL::SSLSocket (expected File) (TypeError)
OpenSSL::SSL::SSLSocket.new(proxy_sock)
^^^^^^^^^^
from tmp/minimal_example.rb:7:in 'Class#new'
from tmp/minimal_example.rb:7:in '<main>'
The real-world use case is a HTTP proxy that has it's own SSL listener. The flow in this scenario is to:
- Open a SSL socket to the proxy
- Negotiate a connection to a external server through the proxy
- Open a SSL socket to the remote server over the existing SSL proxy socket
Looking over the code I don't see any obvious "Here's how to do it" attributes/methods. What is the best way to accomplish this?
Ref: ruby/net-http#212
liath
Metadata
Metadata
Assignees
Labels
No labels