question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Daphne should use Twisted's strports/serverFromString for TLS/ACME support

See original GitHub issue

This would replace this code (https://github.com/andrewgodwin/daphne/blob/master/daphne/server.py#L46) with a user passing a strports description on the command line, which is fed into http://twistedmatrix.com/documents/current/api/twisted.internet.endpoints.html#serverFromString. For example, to support unix sockets it would be unix:/var/run/finger, for TCP it’d be tcp:8000, for basic TLS it would be ssl:443:privateKey=key.pem:certKey=crt.pem, for txsni (TLS w/ SNI) it would be txsni:certificates:tcp:443, and for the automatic, turn-on TLS+SNI, it would be le:/srv/www/certs:tcp:443 (https://github.com/mithrandi/txacme).

I’m happy to implement this, but I thought I’d file an issue since it’s been on my mind for so long 😃

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewgodwincommented, Feb 9, 2017

It does, you have to just use Twisted endpoint syntax and pass it to Daphne using the -e switch. For example:

daphne -e ssl:port=443:privateKey=/etc/ssl/server.pem:extraCertChain=/etc/ssl/chain.pem:sslmethod=SSLv3_METHOD:dhParameters=dh_param_1024.pem

More docs on this here: https://twistedmatrix.com/documents/16.4.1/core/howto/endpoints.html#servers - though there are other things you can do with Twisted endpoints that aren’t there, like let’s encrypt support.

0reactions
davidmarquiscommented, Feb 9, 2017

Also explained pretty clearly on the Daphne README: https://github.com/django/daphne (look for “SSL” on the page)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Securing Ingress Resources - cert-manager Documentation
A common use-case for cert-manager is requesting TLS signed certificates to secure your ingress resources. This can be done by simply adding annotations...
Read more >
Automatic Certificate Management Environment (ACME)
Use of this protocol should radically simplify the deployment of HTTPS ... ACME servers that support TLS 1.3 MAY allow clients to send...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found