Skip to content

Commit e4987b8

Browse files
committed
socat SSL proxy
1 parent 57b46fc commit e4987b8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Linux/socat-ssl-proxy.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# socat SSL proxy
2+
3+
First create a self-signed certificate:
4+
5+
```
6+
openssl genrsa -out server.key 2048
7+
# Note: answer localhost for your Common Name (CN)
8+
# other answers don't really matter
9+
openssl req -new -key server.key -x509 -days 3653 -out server.crt
10+
cat server.key server.crt > server.pem
11+
openssl dhparam -out dhparams.pem 2048
12+
cat dhparams.pem >> server.pem
13+
```
14+
15+
Then use `socat` to listen on port 443 on all interfaces (IPv6 enabled) and forward (unencrypted) to `localhost:80`:
16+
17+
```
18+
socat openssl-listen:443,fork,reuseaddr,cert=server.pem,cafile=server.crt,verify=0,openssl-min-proto-version=TLS1.3 TCP:localhost:80
19+
```

0 commit comments

Comments
 (0)