From ba61a8d00a65948fc0b3a1c100a20cca711fdd0f Mon Sep 17 00:00:00 2001 From: Michał Zieliński Date: Sat, 24 Oct 2015 08:53:18 +0200 Subject: net.nim: support for TLS-PSK ciphersuites --- examples/ssl/pskclient.nim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 examples/ssl/pskclient.nim (limited to 'examples/ssl/pskclient.nim') diff --git a/examples/ssl/pskclient.nim b/examples/ssl/pskclient.nim new file mode 100644 index 000000000..7c93bbb61 --- /dev/null +++ b/examples/ssl/pskclient.nim @@ -0,0 +1,15 @@ +# Create connection encrypted using preshared key (TLS-PSK). +import net + +static: assert defined(ssl) + +let sock = newSocket() +sock.connect("localhost", Port(8800)) + +proc clientFunc(identityHint: string): tuple[identity: string, psk: string] = + echo "identity hint ", identityHint.repr + return ("foo", "psk-of-foo") + +let context = newContext(cipherList="PSK-AES256-CBC-SHA") +context.clientGetPskFunc = clientFunc +context.wrapConnectedSocket(sock, handshakeAsClient) -- cgit 1.4.1-2-gfad0 c.d/net'>log tree commit diff stats
path: root/linux/conf/rc.d/net
blob: a4c566a4456a71d6123ccd1176995f780399b86d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54