pike.git / lib / modules / Protocols.pmod / HTTP.pmod / Server.pmod / SSLPort.pike

version» Context lines:

pike.git/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/SSLPort.pike:18:   //! The function run when a request is received.   //! takes one argument of type @[Request].   //! @param _portno   //! The port number to bind to, defaults to 443.   //! @param _interface   //! The interface address to bind to.   //! @param key   //! An optional SSL secret key, provided in binary format, such   //! as that created by @[Standards.PKCS.RSA.private_key()].   //! @param certificate - //! An optional SSL certificate, provided in binary format. + //! An optional SSL certificate or chain of certificates with the host + //! certificate first, provided in binary format.   void create(function(Request:void) _callback,    void|int _portno, -  void|string _interface, void|string key, void|string certificate) +  void|string _interface, void|string key, void|string|array certificate)   {    portno=_portno;    if (!portno) portno=443; // default HTTPS port       callback=_callback;    interface=_interface;       port=MySSLPort();    port->set_default_keycert();    if(key)
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/SSLPort.pike:54:   {    destruct(port);    port=0;   }      void destroy() { close(); }      //! The port accept callback   static void new_connection()   { -  Stdio.File fd=port->accept(); +  SSL.SSLFile fd=port->accept();    Request r=request_program();    r->attach_fd(fd,this,callback);   }      //!   class MySSLPort   {   #pike __REAL_VERSION__      import Stdio;
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/Server.pmod/SSLPort.pike:135: Inside #if 0
   rsa->set_public_key(n, e);    rsa->set_private_key(d);   #else /* !0 */    // FIXME: Is this correct?    rsa = Standards.PKCS.RSA.parse_private_key(skey);   #endif /* 0 */       }      //! - void set_certificate(string certificate) + void set_certificate(string|array certificate)   { -  +  if(arrayp(certificate)) +  certificates = certificate; +  else    certificates = ({ certificate });   }       void create()    {    sslport::create();    random = Crypto.randomness.arcfour_random(    sprintf("%s%4c", "Foo!", time()))->read;    }      }