Skip to content

Commit 7a1d330

Browse files
committed
only download the root certificate instead of the whole chain
Signed-off-by: reubenmiller <reuben.d.miller@gmail.com>
1 parent cd6f521 commit 7a1d330

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/src/start/connect-c8y.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ This is the certificate chain of the server and not the device's certificate kep
113113
:::
114114

115115
If the Cumulocity server's certificate chain file isn't available locally, it can be downloaded using a web browser or using some other
116-
third-party tools like openssl command as follows:
116+
third-party tools like openssl command to download the root certificate for a given instance:
117117

118118
<UserContext>
119119

120120
```sh
121-
openssl s_client -connect $C8Y_URL:443 < /dev/null 2>/dev/null \
122-
| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
121+
openssl s_client -connect $C8Y_URL:443 -showcerts 2>/dev/null </dev/null \
122+
| awk '/-*BEGIN CERTIFICATE-*/{m=1; last_cert=""} m{last_cert=last_cert"\n"$0} m{if( /-*END CERTIFICATE-*/ ) m=0} END{ sub(/^\n/, "", last_cert); print last_cert}'
123123
```
124124

125125
</UserContext>

0 commit comments

Comments
 (0)