Skip to content

Commit

Permalink
Don't hardcode TLS version to SSLv3
Browse files Browse the repository at this point in the history
SSL 3.0 is now considered insecure (because of the POODLE attack), and
servers are starting to turn it off. In any case, hardcoding a particular
version is a bad idea - let Twisted figure out which version to use.
  • Loading branch information
SpecLad committed Mar 26, 2015
1 parent 05ada3b commit 9b7dc8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
16 changes: 1 addition & 15 deletions master/buildbot/status/mail.py
Expand Up @@ -36,13 +36,6 @@
except ImportError:
ESMTPSenderFactory = None

have_ssl = True
try:
from twisted.internet import ssl
from OpenSSL.SSL import SSLv3_METHOD
except ImportError:
have_ssl = False

# this incantation teaches email to output utf-8 using 7- or 8-bit encoding,
# although it has no effect before python-2.7.
from email import charset
Expand Down Expand Up @@ -816,12 +809,6 @@ def _gotRecipients(self, rlist, m):
def sendmail(self, s, recipients):
result = defer.Deferred()

if have_ssl and self.useTls:
client_factory = ssl.ClientContextFactory()
client_factory.method = SSLv3_METHOD
else:
client_factory = None

if self.smtpUser and self.smtpPassword:
useAuth = True
else:
Expand All @@ -833,8 +820,7 @@ def sendmail(self, s, recipients):
sender_factory = ESMTPSenderFactory(
self.smtpUser, self.smtpPassword,
self.fromaddr, recipients, StringIO(s),
result, contextFactory=client_factory,
requireTransportSecurity=self.useTls,
result, requireTransportSecurity=self.useTls,
requireAuthentication=useAuth)

reactor.connectTCP(self.relayhost, self.smtpPort, sender_factory)
Expand Down
2 changes: 2 additions & 0 deletions master/docs/relnotes/index.rst
Expand Up @@ -85,6 +85,8 @@ Features

* Builders can now have multiple "tags" associated with them. Tags can be used in various status classes as filters (eg, on the waterfall page).

* :bb:status:`MailNotifier` no longer forces SSL 3.0 when ``useTls`` is true.

Fixes
~~~~~

Expand Down

0 comments on commit 9b7dc8d

Please sign in to comment.