Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:2277:    bind (ignore_eaddrinuse);    }       protected string _sprintf( )    {    return "Protocol(" + get_url() + ")";    }   }      #if constant(SSL.sslfile) - class SSLProtocol - //! Base protocol for SSL ports. Exactly like Port, but uses SSL. + //! Base protocol for protocols that support upgrading to TLS. + //! + //! Exactly like Port, but contains settings for TLS. + class StartTLSProtocol   {    inherit Protocol;       // SSL context    SSL.context ctx = SSL.context();       int cert_failure;       protected void cert_err_unbind()    {
Roxen.git/server/base_server/roxen.pike:2535:    inherit Variable.String;       string doc()    {    return sprintf(::doc() + "\n",    combine_path(getcwd(), "../local"),    getcwd());    }    }    -  SSL.sslfile accept() -  { -  Stdio.File q = ::accept(); -  if (q) -  return SSL.sslfile (q, ctx); -  return 0; -  } -  -  protected void bind (void|int ignore_eaddrinuse) -  { -  // Don't bind if we don't have correct certs. -  if (!ctx->certificates) return; -  ::bind (ignore_eaddrinuse); -  } -  +     void create(int pn, string i, void|int ignore_eaddrinuse)    {    ctx->random = Crypto.Random.random_string;       filter_preferred_suites();       set_up_ssl_variables( this_object() );       ::setup(pn, i);   
Roxen.git/server/base_server/roxen.pike:2574:    // FIXME: Both variables ought to be updated on save before the    // changed callback is called. Currently you can get warnings    // that the files don't match if you update both variables    // at the same time.    getvar ("ssl_cert_file")->set_changed_callback (certificates_changed);    getvar ("ssl_key_file")->set_changed_callback (certificates_changed);    }       string _sprintf( )    { +  return "StartTLSProtocol(" + get_url() + ")"; +  } + } +  + class SSLProtocol + //! Base protocol for SSL ports. + //! + //! Exactly like Port, but uses SSL. + { +  inherit StartTLSProtocol; +  +  SSL.sslfile accept() +  { +  Stdio.File q = ::accept(); +  if (q) +  return SSL.sslfile (q, ctx); +  return 0; +  } +  +  protected void bind (void|int ignore_eaddrinuse) +  { +  // Don't bind if we don't have correct certs. +  if (!ctx->certificates) return; +  ::bind (ignore_eaddrinuse); +  } +  +  string _sprintf( ) +  {    return "SSLProtocol(" + get_url() + ")";    }   }   #endif      mapping(string:program/*(Protocol)*/) build_protocols_mapping()   {    mapping protocols = ([]);    int st = gethrtime();    report_debug("Protocol handlers ... \b");
Roxen.git/server/base_server/roxen.pike:5907:    if (!has_value (compat_levels, roxen_ver))    report_debug ("Warning: The current version %s does not exist in "    "roxen.compat_levels.\n", roxen_ver);       add_constant( "Protocol", Protocol );   #ifdef TIMERS    call_out( show_timers, 30 );   #endif      #if constant(SSL.sslfile) +  add_constant( "StartTLSProtocol", StartTLSProtocol );    add_constant( "SSLProtocol", SSLProtocol );   #endif       dump( "etc/modules/Variable.pmod/module.pmod" );    dump( "etc/modules/Variable.pmod/Language.pike" );    dump( "etc/modules/Variable.pmod/Schedule.pike" );       foreach( glob("*.pike", get_dir( "etc/modules/Variable.pmod/"))    -({"Language.pike", "Schedule.pike"}), string f )    DDUMP( "etc/modules/Variable.pmod/"+f );