smtplib.SMTP starttls fails with tlsv1 alert decode error
问题 I encountered the following perculiar behaviour today. The following code works on Python 3.3: smtp = smtplib.SMTP() smtp.connect(host="smtp.gmail.com", port=587) smtp.ehlo() smtp.starttls() In Pyhton 3.4 the above code doesn't work, instead the following error is encountered: File "smtp_test.py", line 10, in <module> smtp.starttls() File "/usr/lib/python3.4/smtplib.py", line 676, in starttls server_hostname=server_hostname) File "/usr/lib/python3.4/ssl.py", line 344, in wrap_socket _context