Skip to content

Commit

Permalink
Support secure WebSocket in DevTools
Browse files Browse the repository at this point in the history
Co-Authored-By: Puja Jagani <[email protected]>
  • Loading branch information
p0deje and pujagani committed Nov 17, 2021
1 parent e5d3644 commit 560a0ae
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion rb/lib/selenium/webdriver/devtools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,18 @@ def wait
end

def socket
@socket ||= TCPSocket.new(ws.host, ws.port)
@socket ||= begin
if URI(@url).scheme == 'ws'
socket = TCPSocket.new(ws.host, ws.port)
socket = OpenSSL::SSL::SSLSocket.new(socket, OpenSSL::SSL::SSLContext.new)
socket.sync_close = true
socket.connect

socket
else
TCPSocket.new(ws.host, ws.port)
end
end
end

def ws
Expand Down

0 comments on commit 560a0ae

Please sign in to comment.