39 lines · 1.4 KB · Text
RawDownload
= ssl: connect, secret: interface to the Secure Sockets Layer     include "sys.m";    include "security.m";    ssl := load SSL SSL->PATH;     connect: fn(fd: ref Sys->FD): (string, ref Sys->Connection);    secret:  fn(c: ref Sys->Connection, secretin,                    secretout: array of byte): string; SSL  provides an interface to the secure sockets layer devicessl(3). Connect allocates a  new  ssl(3)  connection  directory.   Itpushes  file descriptor fd into the data file of that connec‐tion, and if successful, returns a reference to a  Connectionadt  describing  the  connection.  The Connection adt has itsmembers set as follows: dir names  the  resulting  connectiondirectory;  cfd is open on the connection's control file; anddfd is open on the connection's data file, which is read  andwritten to exchange data on the original fd using SSL. Secret  sets the secrets for each direction on Connection c ;if a secret is nil, the existing setting for  that  directionremains  unchanged.   The  string  returned  describes errorsencountered, if any; otherwise it is nil. == source/appl/lib/ssl.b == see ALSOsecurity-auth(2), ssl(3) == diagnosticsConnect returns a tuple containing a string and a  Connectionreference.   On success the string is nil, and the connectionreference is not nil; on error, the string contains  a  diag‐nostic, and the connection reference is nil.