Skip to content

Commit cc035d1

Browse files
committed
Add snippet to generate certificates for minimal-server
1 parent c69902f commit cc035d1

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

lib/shttp/examples/minimal/README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@ This example application makes two requests from the client to the server.
22

33
First, it issues a GET request and downloads an HTML file. Afterwards it sends data to the server via POST.
44

5-
To run the example, first start the server like this
6-
```Go
7-
go run server.go -local 17-ffaa:1:c2,[127.0.0.1]:40002 -cert tls.pem -key tls.key
5+
To run the example, generate a certificate for the server first, e.g
6+
```sh
7+
openssl req -x509 -newkey rsa:1024 -keyout key.pem -nodes -out cert.pem -days 365 -subj '/CN=minimal-server'
8+
```
9+
10+
Start the server like this
11+
```sh
12+
go run server.go -local 17-ffaa:1:c2,[127.0.0.1]:40002 -cert cert.pem -key key.pem
813
```
914

1015
Then, start the client:
11-
```Go
16+
```sh
1217
go run client.go -local 17-ffaa:1:c2,[127.0.0.1]:0
1318
```
1419

1520
For an interactive mode that lets the user choose a path from all available paths add the `-i` flag:
16-
```Go
21+
```sh
1722
go run client.go -local 17-ffaa:1:c2,[127.0.0.1]:0 -i
1823
```
1924

@@ -22,4 +27,4 @@ Make sure to replace the addresses with your own AS addresses and to set the TLS
2227
Also, `minimal-server` must resolve to the SCION address on which you run the server. You can add `minimal-server` to your known hosts by adding the following line to `/etc/hosts`. (replace `ISD-AS` and `IP` with your actual address):
2328
```
2429
ISD-AS,[IP] minimal-server
25-
```
30+
```

0 commit comments

Comments
 (0)