Import std.net.tls
TlsStream
class
Public Class TlsStream<S> Implements Reader, Writer
TLS over S, a stream: what's written goes to the other side through TLS's records, and what's
read came from it. A failure of TLS after the handshake throws an IOError, whose Cause is a
NetError of TLS, and the stream's own failure is thrown as it was. Close sends close_notify,
which a read on the other side ends at; one that ends without it throws an IOError of
UNEXPECTED_END. Neither closes the stream it's on, which Stream gives.
-
The stream it's on.
-
The version of TLS the handshake agreed on: "TLS 1.2" or "TLS 1.3".
-
The application protocol the server picked of those the client offered, or Null for none.
-
The other side's certificate, or Null when it sent none, as a client asked for none does, or it's of a key std.crypto doesn't take.
-
Up to into.Count bytes of what the other side sent, once a record of them has come, or 0 once it closed with close_notify.
-
Read's Async twin: the next bytes TLS's records hold, which waits on the stream's ReadAsync while the main thread goes on.
-
Writes from's bytes to the other side, a record at a time. After Close, it throws an IOError whose Cause is a NetError of CLOSED.
-
Write's Async twin: the bytes, sealed in TLS's records, written by the stream's WriteAsync while the main thread goes on.
-
Flushes the other stream, which holds what it wrote.
-
Flush's Async twin: flushes the stream, by its FlushAsync.
-
Sends close_notify, which tells the other side nothing more comes, and flushes the other stream, the first time; a write after it throws. It doesn't close that stream, which Stream gives, and what the other side sends can still be read.
-
What Close does, without blocking its thread: a call gives its Task.
Report an issue with this page or with FutureBlitz on GitHub.