Branch: Tag:

2014-12-04

2014-12-04 19:25:49 by Henrik Grubbström (Grubba) <grubba@grubba.org>

SSL.https: Log all alerts.

15:      import Stdio;    + class MyContext + { +  inherit SSL.context; +  +  SSL.alert alert_factory(SSL.connection con, +  int level, int description, +  SSL.Constants.ProtocolVersion version, +  string|void message, mixed|void trace) +  { +  if (message) { +  werror("ALERT [%s: %d:%d]: %s", +  SSL.Constants.fmt_version(version), +  level, description, message); +  } +  return ::alert_factory(con, level, description, version, message, trace); +  } + } +    #ifndef HTTPS_CLIENT   SSL.sslport port;      void my_accept_callback(object f)   { -  werror("Accept!\n"); +     conn(port->accept());   }   #endif
138:       protected void create(Stdio.File con)    { -  SSL.context ctx = SSL.context(); +  SSL.context ctx = MyContext();    ctx->random = no_random()->read;    // Make sure all cipher suites are available.    ctx->preferred_suites = ctx->get_suites(-1, 2);
159: Inside #if defined(HTTPS_CLIENT)
   client(con);    return -17;   #else -  SSL.context ctx = SSL.context(); +  SSL.context ctx = MyContext();       Crypto.Sign key;    string certificate;