Open oberstet opened 7 years ago
Apart from the docs, it might be good to have a docker container that's TLS enabled. My main objective for that is to be able to easily test TLS support in our Autobahn libraries. I can probably cook that up, if we want.
Also, there is the built-in Twisted support for Let's Encrypt that provides the le:
and lets:
endpoint-strings. So right now you could get a Let's Encrypt listener by using the "twisted" listener types with an appropriate string. See e.g. https://github.com/twisted/txacme
(The above handles renewing the certificates too). The only real "con" to the above is that it must listen on 443 or it won't work (as the Let's Encrypt "phone home" thing will only use 443).
There's also https://github.com/glyph/txsni but I think the above is better.
be able to easily test TLS support in our Autobahn libraries
Yeah, that would be useful!
For testing with a custom / self-signed cert, there is https://github.com/crossbario/crossbar-examples/tree/master/encryption/tls
However, for testing with a real world cert (eg Lets Encrypt), the tested Crossbar.io instance would need to sit on a public hostname.
FWIW, the canonical place to expand an example for Crossbar.io on Docker with TLS would be here https://github.com/crossbario/crossbar-starter/tree/master/crossbar
@oberstet thank you for the letsencrypt path tip. was trying to point into a homeassisntant docker and wouldn't work with the entire path. I changed to /etc/letsencrypt and worked.
From the mailing list:
TLDR; Using Ubuntu 16.04, I did the following:
Here is some more detail on how it worked ...
1) Create Certificate with Letsencrypt
Then create the certificate for this machine:
Where hostname.domain.com is your server name. After this is successful, I have a directory with the following 2 files:
/etc/letsencrypt/live//privkey.pem
/etc/letsencrypt/live//fullchain.pem
Some of these paths are symbolic links, so in order to be able to chase all the symlinks from inside docker, we need to mount the entire /etc/letsencrypt root directory:
2) mount certificate directory into crossbar docker container
When I create my docker container, I needed to mount the Ubuntu letsencrypt directory to the container:
This way, the docker container will have /etc/letsencrypt mounted inside it and will be able to reference the *.pem files from our config.json file.
3) Configure crossbar to use TLS certificates by adding the websocket transport configs like so: