File: README.md

package info (click to toggle)
python-autobahn 23.1.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,424 kB
  • sloc: python: 38,620; javascript: 2,705; makefile: 899; ansic: 373; sh: 63
file content (30 lines) | stat: -rw-r--r-- 1,107 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# TLS

This demonstrates how to use a custom `sslContextFactory` for
SSL4ClientEndpoints to control how TLS verification is
done. Specifically, we connect via wss:// to a TLS-enabled backend
with a self-signed certificate.

Use the script "create-self-signed-cert.sh" to create a new
certificate in `server.crt` (with corresponding private key
`server.key`). You can teach crossbar about your certificate by adding
a "transport" configuration like the following (this can be dropped
straight into examples/router/.crossbar/config.json)::

    {
        "type": "websocket",
        "id": "tls_test0",
        "endpoint": {
            "type": "tcp",
            "port": 8083,
            "tls": {
                "key": "../../twisted/wamp/pubsub/tls/server.key",
                "certificate": "../../twisted/wamp/pubsub/tls/server.crt"
            }
        }
    }

`backend_selfsigned.py` is designed to connect to a transport
configured as above, and also needs access to the `server.crt`
file. So you can simply run `create-self-signed-cert.sh` here and the
above should read the same files directly.