Std.Tls.connect
1 declaration
fn
connect: Str -> Int -> Result[Std.Tls.Secured, Std.Tls.TlsError]This is a callable function.
What it does
Open a connection and prove the far end is the host that was named.
There is no argument that turns the proof off. A caller given one would
eventually use it to make something work, and what it produces is a
connection encrypted against a stranger rather than private with the
intended server — worse than an unsecured one, because it looks safe.
Trust comes from the machine's own store, so an organisation that has told
its machines about an internal authority is believed without this library
keeping a list that would go stale.
Read the signature
- The text after the name is the type checked by Pudu.
- Read arrows from left to right: inputs come first, and the final type is returned.
- Names inside [ ] are type arguments, such as the item type held by a collection.
- Result makes success and recoverable failure part of the function's type.
