Skip to content

Instantly share code, notes, and snippets.

@knu
Created April 9, 2019 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knu/182ebf76c3c4c271787a4e8c059203e8 to your computer and use it in GitHub Desktop.
Save knu/182ebf76c3c4c271787a4e8c059203e8 to your computer and use it in GitHub Desktop.
require 'net/protocol'
class Net::Protocol
module ForceSNI
def ssl_socket_connect(*)
@sock.hostname = @host if @sock.respond_to? :hostname=
super
end
end
prepend ForceSNI
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment