Skip to content

Commit

Permalink
Force SNI support in Net modules for IMAP/POP3/SMTP
Browse files Browse the repository at this point in the history
  • Loading branch information
knu committed Apr 10, 2019
1 parent 0d41108 commit 7ae44c8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions config/initializers/force_sni.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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

0 comments on commit 7ae44c8

Please sign in to comment.