Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mutalisk999 committed Oct 8, 2022
1 parent bcef707 commit 1ef12df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@

### How to generate cert file and key file

```
mkdir certs
rm certs/*
# for tls server
openssl req -new -nodes -x509 -out certs/server.pem -keyout certs/server.key -days 36500
# for tls client
openssl req -new -nodes -x509 -out certs/client.pem -keyout certs/client.key -days 36500
```


```
mkdir certs
rm certs/*
Expand All @@ -34,7 +22,6 @@ openssl x509 -req -in certs/server.csr -out certs/server.pem -signkey certs/serv
openssl genrsa -out certs/client.key 2048
openssl req -new -key certs/client.key -out certs/client.csr
openssl x509 -req -in certs/client.csr -out certs/client.pem -signkey certs/client.key -CA certs/ca.pem -CAkey certs/ca.key -CAcreateserial -days 36500
```

### Client
Expand Down
7 changes: 6 additions & 1 deletion cmd/tls-proxy-client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ func clientHandler(conn *net.TCPConn, config *tls_proxy_go.ClientConfig) {
return
}

tlsConfig := tls.Config{Certificates: []tls.Certificate{cert}, InsecureSkipVerify: true, RootCAs: certPool}
tlsConfig := tls.Config{
Certificates: []tls.Certificate{cert},
InsecureSkipVerify: true,
RootCAs: certPool,
}

clientConn, err := tls.Dial("tcp",
fmt.Sprintf("%s:%d", config.ServerHost, config.ServerPort),
&tlsConfig)
Expand Down

0 comments on commit 1ef12df

Please sign in to comment.