Skip to content

Commit 40e2146

Browse files
committed
add minimal tls interface
inspired by WebAssembly#104 Signed-off-by: Joel Dice <joel.dice@fermyon.com>
1 parent 74ea247 commit 40e2146

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

wit/tls.wit

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@unstable(feature = tls)
2+
interface tls {
3+
@unstable(feature = tls)
4+
use wasi:io/streams@0.2.1.{input-stream, output-stream};
5+
@unstable(feature = tls)
6+
use wasi:io/poll@0.2.1.{pollable};
7+
8+
@unstable(feature = tls)
9+
resource client-connection {
10+
@unstable(feature = tls)
11+
constructor(input: input-stream, output: output-stream);
12+
@unstable(feature = tls)
13+
connect: func(server-name: string) -> result<client-handshake>;
14+
}
15+
16+
@unstable(feature = tls)
17+
resource client-handshake {
18+
@unstable(feature = tls)
19+
finish: static func(this: client-handshake) -> future-streams;
20+
}
21+
22+
@unstable(feature = tls)
23+
resource future-streams {
24+
@unstable(feature = tls)
25+
subscribe: func() -> pollable;
26+
@unstable(feature = tls)
27+
get: func() -> option<result<result<tuple<input-stream, output-stream>>>>;
28+
}
29+
}
30+

wit/world.wit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ world imports {
1616
import tcp-create-socket;
1717
@since(version = 0.2.0)
1818
import ip-name-lookup;
19+
@unstable(feature = tls)
20+
import tls;
1921
}

0 commit comments

Comments
 (0)