Skip to content

Commit c6d1da1

Browse files
committed
improve labgrid tls docs
Signed-off-by: Asher Pemberton <asher.pemberton@arm.com> Reviewed-by: Asher Pemberton <asher.pemberton@arm.com> # gatekeeper
1 parent a9a4120 commit c6d1da1

3 files changed

Lines changed: 59 additions & 4 deletions

File tree

doc/getting_started.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,14 @@ Refer to the ``labgrid-coordinator`` man page for details.
446446

447447
When you are connecting with ``labgrid-client`` or ``labgrid-exporter`` to a
448448
``labgrid-coordinator`` that has TLS gRPC channels enabled you need to pass
449-
the ``--tls`` (and ``--cert`` if the certificate is not trusted by the host
450-
machine) option.
449+
the ``--tls`` option. If ``--cert`` is not set, labgrid uses the host CA
450+
certificates to verify the coordinator certificate. Use ``--cert`` to provide
451+
a specific CA certificate instead.
451452
Refer to the ``labgrid-client`` and ``labgrid-exporter`` man pages for details.
452453
For ``RemotePlace`` connections from an environment config, set the
453-
``coordinator_tls`` option or ``LG_COORDINATOR_TLS``. If the certificate
454-
is not trusted by the host machine, set ``coordinator_cert`` in the config.
454+
``coordinator_tls`` option or ``LG_COORDINATOR_TLS``. If ``coordinator_cert``
455+
is not set, labgrid uses the host CA certificates. Set ``coordinator_cert``
456+
to provide a specific CA certificate instead.
455457

456458
Using a Strategy
457459
----------------

doc/man/coordinator.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,32 @@ OPTIONS
3434
-d, --debug
3535
enable debug mode
3636

37+
TLS WITH A REVERSE PROXY
38+
------------------------
39+
40+
Instead of enabling TLS in ``labgrid-coordinator`` directly, a reverse proxy can
41+
terminate TLS and forward cleartext gRPC to the coordinator. For example, with
42+
``nginx``:
43+
44+
.. code-block:: nginx
45+
46+
server {
47+
listen 20407 ssl http2;
48+
server_name labgrid.example.com;
49+
50+
ssl_certificate /etc/ssl/labgrid-coordinator.crt;
51+
ssl_certificate_key /etc/ssl/labgrid-coordinator.key;
52+
53+
location / {
54+
grpc_pass grpc://127.0.0.1:20408;
55+
}
56+
}
57+
58+
In this setup, start ``labgrid-coordinator`` without ``--tls`` and point
59+
``labgrid-client`` and ``labgrid-exporter`` at the reverse proxy using
60+
``--tls``.
61+
62+
3763
SEE ALSO
3864
--------
3965

man/labgrid-coordinator.1

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,33 @@ path to TLS key (in PEM format)
6363
.B \-d\fP,\fB \-\-debug
6464
enable debug mode
6565
.UNINDENT
66+
.SS TLS WITH A REVERSE PROXY
67+
.sp
68+
Instead of enabling TLS in \fBlabgrid\-coordinator\fP directly, a reverse proxy can
69+
terminate TLS and forward cleartext gRPC to the coordinator. For example, with
70+
\fBnginx\fP:
71+
.INDENT 0.0
72+
.INDENT 3.5
73+
.sp
74+
.EX
75+
server {
76+
listen 20407 ssl http2;
77+
server_name labgrid.example.com;
78+
79+
ssl_certificate /etc/ssl/labgrid\-coordinator.crt;
80+
ssl_certificate_key /etc/ssl/labgrid\-coordinator.key;
81+
82+
location / {
83+
grpc_pass grpc://127.0.0.1:20408;
84+
}
85+
}
86+
.EE
87+
.UNINDENT
88+
.UNINDENT
89+
.sp
90+
In this setup, start \fBlabgrid\-coordinator\fP without \fB\-\-tls\fP and point
91+
\fBlabgrid\-client\fP and \fBlabgrid\-exporter\fP at the reverse proxy using
92+
\fB\-\-tls\fP\&.
6693
.SS SEE ALSO
6794
.sp
6895
\fBlabgrid\-client\fP(1), \fBlabgrid\-exporter\fP(1)

0 commit comments

Comments
 (0)