$ twistd -n web --port ssl:12345:certKey=server.pem
2017-01-09T08:01:57-0500 [twisted.scripts._twistd_unix.UnixAppLogger#info] twistd 16.4.1 (/usr/bin/python 2.7.12) starting up.
2017-01-09T08:01:57-0500 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: twisted.internet.epollreactor.EPollReactor.
2017-01-09T08:01:57-0500 [-] Site (TLS) starting on 12345
2017-01-09T08:01:57-0500 [twisted.web.server.Site#info] Starting factory <twisted.web.server.Site instance at 0x7f3476497cb0>
This txaws-based program:
$ cat testit.py
from __future__ import print_function
from txaws.client.base import BaseQuery
from txaws.service import AWSServiceEndpoint
from twisted.internet.task import react
def main(reactor):
endpoint = AWSServiceEndpoint(ssl_hostname_verification=True)
q = BaseQuery(action=b"GET", endpoint=endpoint, reactor=reactor)
d = q.get_page(b"https://localhost:12345/")
d.addCallback(print)
return d
react(main, [])
produces this result:
$ python testit.py
<html>
<head><title>Twisted Web Demo</title><head>
<body>
Hello! This is a Twisted Web test page.
</body>
</html>
There is no way the default for txAWS HTTPS requests should be to silently allow communication with a TLS server using such a certificate (self-signed, expired, mismatching hostname).
Given
and
This txaws-based program:
produces this result:
There is no way the default for txAWS HTTPS requests should be to silently allow communication with a TLS server using such a certificate (self-signed, expired, mismatching hostname).