]> gitweb.factorcode.org Git - factor.git/blob - basis/io/sockets/secure/openssl/openssl-docs.factor
io.sockets.secure.openssl: Fix docs
[factor.git] / basis / io / sockets / secure / openssl / openssl-docs.factor
1 USING: help.markup help.syntax io.files io.buffers kernel openssl.libssl
2 strings sequences ;
3 IN: io.sockets.secure.openssl
4
5 HELP: subject-name
6 { $values { "certificate" "an SSL peer certificate" } { "host" string } }
7 { $description "The subject name of a certificate." } ;
8
9 HELP: subject-names-match?
10 { $values { "name" "a host name" } { "pattern" "a subject name" } { "?" boolean } }
11 { $description "True if the host name matches the subject name." }
12 { $examples
13     { $code
14         "\"www.google.se\" \"*.google.se\" subject-names-match?"
15         "t"
16     }
17 } ;
18
19 HELP: alternative-dns-names
20 { $values { "certificate" "an SSL peer certificate" } { "dns-names" sequence } }
21 { $description "Alternative subject names for the certificate." } ;
22
23 HELP: do-ssl-connect
24 { $values { "ssl-handle" ssl-handle } }
25 { $description "Connects the SSL handle to the remote server. Blocks until the connection is established or an error is thrown." } ;
26
27 HELP: do-ssl-read
28 { $values
29   { "buffer" buffer }
30   { "ssl-handle" ssl-handle }
31   { "event/f" { $maybe "a symbol indicating the desired operation" } } }
32 { $description "Reads from the ssl connection to the buffer." } ;
33
34 HELP: do-ssl-write
35 { $values
36   { "buffer" buffer }
37   { "ssl-handle" ssl-handle }
38   { "event/f" { $maybe "a symbol indicating the desired operation" } } }
39 { $description "Writes from the buffer to the ssl connection." } ;
40
41 HELP: check-ssl-error
42 { $values
43   { "ssl-handle" ssl-handle }
44   { "ret" "error code returned by an SSL function" }
45   { "event/f" { $maybe "a symbol indicating the desired operation" } }
46 }
47 { $description "Checks if the last SSL function returned successfully or not. If so, returns " { $link f } " or a symbol, " { $link +input+ } " or " { $link +output+ } ", that indicates the socket operation required by libssl." } ;
48
49 HELP: maybe-handshake
50 { $values
51   { "ssl-handle" ssl-handle }
52 } { $description "Performs SSL handshaking (using " { $link SSL_accept } ") if the handle isn't connected. Then sets its state to connected." } ;