Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhiweiyin318/httptest
https://github.com/zhiweiyin318/httptest
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/zhiweiyin318/httptest
- Owner: zhiweiyin318
- Created: 2023-12-12T01:11:11.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-12T08:14:03.000Z (about 1 year ago)
- Last Synced: 2024-11-13T16:24:40.426Z (3 months ago)
- Language: Go
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
1. build
```
go build -o bin/server ./server
go build -o bin/client ./client
```2. tls
```
openssl genrsa -out ca.key 2048openssl req -new -x509 -days 36500 -key ca.key -out ca.crt -config openssl.cnf
openssl genrsa -out server.key 2048
openssl req -new -key server.key -out server.csr -config openssl.cnf
openssl x509 -req -days 36500 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -extfile <(printf "subjectAltName=IP.1:127.0.0.1")
```2. run
```
go run httpserver/server.go --cert="tls/server.crt" --key="tls/server.key"go run httpclient/client.go --addr="http://127.0.0.1:8090" --ca="tls/ca.crt"
curl --cacert "tls/ca.crt" -k https://localhost:8090/hello
go run http2server/server.go --cert="tls/server.crt" --key="tls/server.key"
go run http2client/client.go --addr="http://127.0.0.1:8090" --ca="tls/ca.crt"
curl --cacert "tls/ca.crt" -v --http2-prior-knowledge -k https://localhost:8090/hello
```