Go to the documentation of this file.
17 #define HOME "/usr/users/sampo/demo/"
18 #define CERTF HOME "plain-cert.pem"
19 #define KEYF HOME "plain-key.pem"
21 #define CHK_NULL(x) if ((x)==NULL) exit (1)
22 #define CHK_ERR(err,s) if ((err)==-1) \
23 { fprintf(log, "%s %d\n", (s), errno); exit(1); }
24 #define CHK_SSL(err) if ((err)==-1) { ERR_print_errors_fp(log); exit(2); }
36 log = fopen (
"/dev/console",
"a");
CHK_NULL(log);
37 fprintf (log,
"inetdserv %ld\n", (
long)getpid());
62 if (client_cert != NULL) {
63 fprintf (log,
"Client certificate:\n");
67 fprintf (log,
"\t subject: %s\n", str);
72 fprintf (log,
"\t issuer: %s\n", str);
78 X509_free (client_cert);
80 fprintf (log,
"Client doe not have certificate.\n");
87 fprintf (log,
"Got %d chars:'%s'\n", err, buf);
89 err =
SSL_write (ssl,
"Loud and clear.", strlen(
"Loud and clear."));