# Buggy code
def getCertificateOptions(self):
    # setting verify=True will require you to provide CAs
    # to verify against; in other words: it's not that simple

    # backward-compatible SSL/TLS method:
    #
    # * this will respect `method` attribute in often recommended
    #   `ScrapyClientContextFactory` subclass
    #   (https://github.com/scrapy/scrapy/issues/1429#issuecomment-131782133)
    #
    # * getattr() for `_ssl_method` attribute for context factories
    #   not calling super(..., self).__init__
    return CertificateOptions(
        verify=False, method=getattr(self, "method", getattr(self, "_ssl_method", None))
    )


# Traceback (OpenSSL.SSL.Error)
2016-10-06 22:15:40 [scrapy] DEBUG: Telnet console listening on 127.0.0.1:6043
2016-10-06 22:15:40 [scrapy] INFO: Spider opened
2016-10-06 22:15:40 [scrapy] DEBUG: Retrying <GET https://subscribe.wsj.com/printpack/> (failed 1 times): [<twisted.python.failure.Failure OpenSSL.SSL.Error: [('SSL routines', 'SSL23_GET_SERVER_HELLO', 'sslv3 alert handshake failure')]>]
2016-10-06 22:15:40 [scrapy] DEBUG: Retrying <GET https://subscribe.wsj.com/printpack/> (failed 2 times): [<twisted.python.failure.Failure OpenSSL.SSL.Error: [('SSL routines', 'SSL23_GET_SERVER_HELLO', 'sslv3 alert handshake failure')]>]
2016-10-06 22:15:40 [scrapy] DEBUG: Gave up retrying <GET https://subscribe.wsj.com/printpack/> (failed 3 times): [<twisted.python.failure.Failure OpenSSL.SSL.Error: [('SSL routines', 'SSL23_GET_SERVER_HELLO', 'sslv3 alert handshake failure')]>]
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 11, in <module>
sys.exit(execute())
File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 142, in execute
_run_print_help(parser, _run_command, cmd, args, opts)
File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 88, in _run_print_help
func(*a, **kw)
File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 149, in _run_command
cmd.run(args, opts)
File "/usr/local/lib/python2.7/dist-packages/scrapy/commands/shell.py", line 71, in run
shell.start(url=url)
File "/usr/local/lib/python2.7/dist-packages/scrapy/shell.py", line 47, in start
self.fetch(url, spider)
File "/usr/local/lib/python2.7/dist-packages/scrapy/shell.py", line 112, in fetch
reactor, self._schedule, request, spider)
File "/usr/local/lib/python2.7/dist-packages/twisted/internet/threads.py", line 122, in blockingCallFromThread
result.raiseException()
File "<string>", line 2, in raiseException
twisted.web._newclient.ResponseNeverReceived: [<twisted.python.failure.Failure OpenSSL.SSL.Error: [('SSL routines', 'SSL23_GET_SERVER_HELLO', 'sslv3 alert handshake failure')]>]

# Fixed code
def getCertificateOptions(self):
    # setting verify=True will require you to provide CAs
    # to verify against; in other words: it's not that simple

    # backward-compatible SSL/TLS method:
    #
    # * this will respect `method` attribute in often recommended
    #   `ScrapyClientContextFactory` subclass
    #   (https://github.com/scrapy/scrapy/issues/1429#issuecomment-131782133)
    #
    # * getattr() for `_ssl_method` attribute for context factories
    #   not calling super(..., self).__init__
    return CertificateOptions(
        verify=False,
        method=getattr(self, "method", getattr(self, "_ssl_method", None)),
        fixBrokenPeers=True,
        acceptableCiphers=DEFAULT_CIPHERS,
    )