Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNI support #3

Open
hengwoon opened this issue Mar 16, 2020 · 2 comments
Open

SNI support #3

hengwoon opened this issue Mar 16, 2020 · 2 comments

Comments

@hengwoon
Copy link

Are there plans to support SNI with Net::SMTP? Currently the TLS connection fails with a OpenSSL::SSL::SSLError: hostname foo.bar.com does not match the server certificate, where the cert has a subject name of bar.com, but is a multi-domain cert with foo.bar.com as a subject alternative name

Currently this is what I am doing:

module Net
  class SMTP
    module ForceSNI
      private
      def ssl_socket(socket, context)
        s = super
        s.hostname = @address if s.respond_to? :hostname=
        s
      end
    end

    prepend ForceSNI
  end
end

Unless I'm missing an option or something, I don't see a way to enable SNI currently

@nevans
Copy link
Contributor

nevans commented Mar 24, 2020

FYI: I didn't reallize net/smtp had been extracted to a gem (lib/net/smtp.rb still exists in the ruby repository). So I opened a ruby issue here: https://bugs.ruby-lang.org/issues/16611 and a github PR here: ruby/ruby#2883

@nevans
Copy link
Contributor

nevans commented Mar 24, 2020

Okay, see #4 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants