Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:2316:       protected void create()    {    path = "";    port = default_port;    ip = "0.0.0.0";    }   }      #if constant(SSL.sslfile) +  + class SSLContext { + #if constant(SSL.Context) +  inherit SSL.Context; +  + #if defined(DEBUG) || defined(SSL3_DEBUG) +  SSL.Alert alert_factory(SSL.Connection con, int level, int description, +  SSL.Constants.ProtocolVersion version, +  string|void debug_message) +  { +  if (description != SSL.Constants.ALERT_close_notify) { +  if (debug_message) { +  werror("SSL %s: %s: %s", +  (level == SSL.Constants.ALERT_warning)? +  "WARNING":"ERROR", +  SSL.Constants.fmt_constant(description, "ALERT"), +  debug_message); +  } else { +  werror("SSL %s: %s\n", +  (level == SSL.Constants.ALERT_warning)? +  "WARNING":"ERROR", +  SSL.Constants.fmt_constant(description, "ALERT")); +  } +  } +  return ::alert_factory(con, level, description, version, debug_message); +  } + #endif /* DEBUG || SSL3_DEBUG */ +  + #else +  inherit SSL.context; + #endif + } +    class SSLProtocol   //! Base protocol for SSL ports. Exactly like Port, but uses SSL.   {    inherit Protocol;       // SSL context -  SSL.context ctx = SSL.context(); +  SSLContext ctx = SSLContext();       int cert_failure;       protected void cert_err_unbind()    {    if (bound > 0) {    port_obj->close();    report_warning ("TLS port %s closed.\n", get_url());    bound = 0;    }
Roxen.git/server/base_server/roxen.pike:2545: Inside #if constant(Standards.X509)
   CERT_ERROR (KeyFile, LOC_M (17,"No private key found.\n"));    report_error ("TLS port %s: %s", get_url(),    LOC_M (17,"No private key found.\n"));    cert_err_unbind();    cert_failure = 1;    return;    }       if (sizeof(ctx->cert_pairs)) {    // We must reset the set of certificates. -  ctx = SSL.context(); +  ctx = SSLContext();    set_version();    filter_preferred_suites();    }       mapping(string:array(int)) cert_lookup = ([]);    foreach(decoded_certs; int no; Standards.X509.TBSCertificate tbs) {    cert_lookup[tbs->subject->get_der()] += ({ no });    }       foreach(decoded_keys, Crypto.Sign key) {
Roxen.git/server/base_server/roxen.pike:2825:    {    return sprintf(::doc() + "\n",    combine_path(getcwd(), "../local"),    getcwd());    }    }       SSL.sslfile accept()    {    Stdio.File q = ::accept(); -  if (q) -  return SSL.sslfile (q, ctx); +  if (q) { +  SSL.sslfile ssl = SSL.sslfile (q, ctx); +  if (ssl->accept) ssl->accept(); +  return ssl; +  }    return 0;    }      #if constant(SSL.Connection)    protected void bind (void|int ignore_eaddrinuse)    {    // Don't bind if we don't have correct certs.    if (!sizeof(ctx->cert_pairs)) return;    ::bind (ignore_eaddrinuse);    }