ruby / ruby/net-smtp

SNI support

Open
#3 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
70
Forks
34
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Net::SMTP's TLS setup and the ssl_socket path, using the reported ForceSNI module as the reference for the current workaround. Confirm the change handles a hostname such as foo.bar.com with a certificate whose subject alternative name includes it, and verify the existing SMTP TLS behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.