selfcert/README.md
2024-03-24 13:27:37 +03:00

34 lines
675 B
Markdown

# Self Signed Certs
This app starts HTTPS server with auto-generated self signed certificate.
Use `-p` to specify server port. Default is `10453`.
Use `-o` to specify path to output file for the certificate. Default is `./cert.pem`
## Example
Start server application
```
$ cd server
$ go run main.go -o cert.pem
```
Try to connect with default settings and receive error.
```
$ curl https://localhost:10453
curl: (60) SSL certificate problem: self-signed certificate
```
Receive 200 OK response after adding `-k` flag.
```
$ curl -k https://localhost:10453
```
Receive 200 OK by using `--cacert` option.
```
$ curl --cacert cert.pem https://localhost:10453
```