Skip to content

Commit c7f9dce

Browse files
authored
Merge pull request #44 from mcpcpc/tor
add SASL EXTERNAL example
2 parents f57175b + bf9f3c9 commit c7f9dce

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,18 @@ usage: kirc [-s hostname] [-p port] [-c channel] [-n nick] [-r real name] [-u us
8888

8989
## Transport Layer Security (TLS) Support
9090

91-
There is no native TLS/SSL support. Instead, users can achieve this functionality by using third-party tools (e.g. stunnel, socat, ghosttunnel).
91+
There is no native TLS/SSL support. Instead, users can achieve this functionality by using third-party utilities (e.g. stunnel, socat, ghosttunnel, etc).
9292

93-
* _socat_ example:
93+
* [socat](https://linux.die.net/man/1/socat) example (remember to replace items enclosed with `<>`):
9494

9595
```shell
9696
socat tcp-listen:6667,reuseaddr,fork,bind=127.0.0.1 ssl:<irc-server>:6697
9797
kirc -s 127.0.0.1 -c 'channel' -n 'name' -r 'realname'
9898
```
9999

100-
## PLAIN SASL Authentication
100+
## SASL PLAIN Authentication
101101

102-
In order to connect using PLAIN SASL authentication, the user must provide the required token during the initial connection. If the authentication token is base64 encoded and, therefore, can be generated a number of ways. For example, using Python, one could use the following:
102+
In order to connect using `SASL PLAIN` mechanism authentication, the user must provide the required token during the initial connection. If the authentication token is base64 encoded and, therefore, can be generated a number of ways. For example, using Python, one could use the following:
103103

104104
```shell
105105
python -c 'import base64; print(base64.encodebytes(b"nick\x00nick\x00password"))'
@@ -113,6 +113,18 @@ b 'amlsbGVzAGppbGxlcwBzZXNhbWU=\n'
113113
$ kirc -n jilles -a amlsbGVzAGppbGxlcwBzZXNhbWU=
114114
```
115115

116+
## SASL EXTERNAL Authentication
117+
118+
Similar to `SASL PLAIN`, the `SASL EXTERNAL` mechanism allows us to authenticate using credentials by external means. An example where this might be required is when trying to connect to an IRC host through [Tor](https://www.torproject.org/). To do so, we can using third-party utilities (e.g. stunnel, socat, ghosttunnel, etc).
119+
120+
* [socat](https://linux.die.net/man/1/socat) example (remember to replace items enclosed with `<>`):
121+
122+
```shell
123+
socat TCP4-LISTEN:1110,fork,bind=0,reuseaddr SOCKS4A:127.0.0.1:<onion_address.onion>:<onion_port>,socksport=9050
124+
socat TCP4-LISTEN:1111,fork,bind=0,reuseaddr 'OPENSSL:127.0.0.1:1110,verify=0,cert=<path_to_pem>'
125+
kirc -e -s 127.0.0.1 -p 1111 -n <nick> -x 'wait 5000'
126+
```
127+
116128
## Contact
117129

118130
For any further questions or concerns, feel free to reach out to me on `#kirc`

0 commit comments

Comments
 (0)