diff options
author | Fred Drake <fdrake@acm.org> | 2001-09-25 15:48:11 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-09-25 15:48:11 (GMT) |
commit | 9081bb1d21b0a0f6812099e5f2207f28c7e1b944 (patch) | |
tree | 40251aeb652a2ad3da3d6ec69bb4e084b7fc166b /Doc/lib/libsocket.tex | |
parent | 74f1a563ffe184e90f2d986d0da34580773de5a1 (diff) | |
download | cpython-9081bb1d21b0a0f6812099e5f2207f28c7e1b944.zip cpython-9081bb1d21b0a0f6812099e5f2207f28c7e1b944.tar.gz cpython-9081bb1d21b0a0f6812099e5f2207f28c7e1b944.tar.bz2 |
Added documentation for the SSL interface, contributed by Gerhard Häring.
This closes SF patch #461337.
Diffstat (limited to 'Doc/lib/libsocket.tex')
-rw-r--r-- | Doc/lib/libsocket.tex | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Doc/lib/libsocket.tex b/Doc/lib/libsocket.tex index 3e58559..2468aec 100644 --- a/Doc/lib/libsocket.tex +++ b/Doc/lib/libsocket.tex @@ -265,6 +265,15 @@ protocol number. The address family should be \constant{AF_INET}, \constant{AF_ The protocol number is usually zero and may be omitted in that case. \end{funcdesc} +\begin{funcdesc}{ssl}{sock, keyfile, certfile} +Initiate a SSL connection over the socket \var{sock}. \var{keyfile} is +the name of a PEM formatted file that contains your private +key. \var{certfile} is a PEM formatted certificate chain file. On +success, a new \class{SSLObject} is returned. + +\strong{Warning:} This does not do any certificate verification! +\end{funcdesc} + \begin{funcdesc}{fromfd}{fd, family, type\optional{, proto}} Build a socket object from an existing file descriptor (an integer as returned by a file object's \method{fileno()} method). Address family, @@ -510,6 +519,20 @@ use \method{recv()} and \method{send()} without \var{flags} argument instead. +\subsection{SSL Objects \label{ssl-objects}} + +SSL objects have the following methods. + +\begin{methoddesc}{write}{s} +Writes the string \var{s} to the on the object's SSL connection. +The return value is the number of bytes written. +\end{methoddesc} + +\begin{methoddesc}{read}{\optional{n}} +If \var{n} is provided, read \var{n} bytes from the SSL connection, otherwise +read until EOF. The return value is a string of the bytes read. +\end{methoddesc} + \subsection{Example \label{socket-example}} Here are four minimal example programs using the TCP/IP protocol:\ a |