[Twisted-web] Listening on 2 addresses
Axel Rau
Axel.Rau at Chaos1.DE
Sun Mar 31 09:34:26 MDT 2019
Hi Tom,
thanks for the explanation. After adding some brackets, your example code works like a charm.
>
> [1]: https://twistedmatrix.com/documents/current/api/twisted.application.service.MultiService.html <https://twistedmatrix.com/documents/current/api/twisted.application.service.MultiService.html>
> [2]: https://twistedmatrix.com/documents/current/api/twisted.application.internet.StreamServerEndpointService.html <https://twistedmatrix.com/documents/current/api/twisted.application.internet.StreamServerEndpointService.html>
> [3]: https://twistedmatrix.com/documents/current/api/twisted.internet.endpoints.html#serverFromString <https://twistedmatrix.com/documents/current/api/twisted.internet.endpoints.html#serverFromString>
Using your pointers, I tried the next step: TLS.
This variant of the makeService method:
ipv4_endpoint = endpoints.serverFromString(
reactor, 'ssl:{}:privateKey={}:certKey={}:interface={}'.format(
options['port'],
endpoints.quoteStringArgument(options['cert_path']),
endpoints.quoteStringArgument(options['key_path']),
options['ipv4_address']))
ipv6_endpoint = endpoints.serverFromString(
reactor, 'ssl:{}:privateKey={}:certKey={}:interface={}'.format(
options['port'],
endpoints.quoteStringArgument(options['cert_path']),
endpoints.quoteStringArgument(options['key_path']),
options['ipv6_address']))
ipv4 = internet.StreamServerEndpointService(ipv4_endpoint, meteo_factory)
ipv6 = internet.StreamServerEndpointService(ipv6_endpoint, meteo_factory)
root = MultiService()
ipv4.setServiceParent(root)
ipv6.setServiceParent(root)
does not work. It fails with:
_parseSSL() got multiple values for argument ‚interface'
same with private privateKey and certKey.
What did I wrong this time?
Thanks, Axel
---
PGP-Key:29E99DD6 ☀ computing @ chaos claudius
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-web/attachments/20190331/bb59d556/attachment.html>
More information about the Twisted-web
mailing list