Skip to content

Commit

Permalink
readme & makeCerts fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
faroyam committed Aug 20, 2018
1 parent f074bdb commit 2a77220
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# golang-p2p-chat

console chat with auto reconnection written in go
console chat with auto reconnection and TLS encryption written in go

### Installing

```
go get github.com/faroyam/golang-p2p-chat
```

## Getting Started

1. Generate SSL keys for TSL
```
bash makeCerts.sh
```
2. Run chat
```
go build chat.go && ./chat <username> <remote IP>
```
9 changes: 5 additions & 4 deletions makeCerts.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mkdir certs 2>/dev/null
rm certs/* 2>/dev/null
echo "make server cert"
openssl req -new -nodes -x509 -out certs/server.pem -keyout certs/server.key -days 3650 -subj "/C=RU/ST=MSK/L=MSK/O=Chat Company/OU=IT/CN=www.chat.com/emailAddress=$1"
echo "make client cert"
openssl req -new -nodes -x509 -out certs/client.pem -keyout certs/client.key -days 3650 -subj "/C=RU/ST=MSK/L=MSK/O=Chat Company/OU=IT/CN=www.chat.com/emailAddress=$1"
echo "creating server cert"
openssl req -new -nodes -x509 -out certs/server.pem -keyout certs/server.key -days 3650 -subj "/C=RU/ST=MSK/L=MSK/O=Chat Company/OU=IT/CN=www.chat.com/[email protected]"
echo "creating client cert"
openssl req -new -nodes -x509 -out certs/client.pem -keyout certs/client.key -days 3650 -subj "/C=RU/ST=MSK/L=MSK/O=Chat Company/OU=IT/CN=www.chat.com/[email protected]"
echo "done"

0 comments on commit 2a77220

Please sign in to comment.