Problems with the callback verification

Rosa Sanchez Guerrero rosa.rsg at gmail.com
Tue Jun 2 16:13:00 EDT 2009


Hi,

 I want to use the library LibNeon to make a callback verification and
for that, I am using the following code, using the function from
dump_cert
ne_ssl_cert_subjectcertification :

static int
my_verify (void * userdata, int failures, const ne_ssl_certificate * cert)
(
  const char * hostname = userdata;

  dump_cert (cert);

  puts ( "Certificate verification failed \ - the connection may have been"
       "intercepted by a third party!");

  if (failures & NE_SSL_IDMISMATCH) (
    const char * id = ne_ssl_cert_identity (cert);
    if (id)
      printf ( "Server certificate was issued to \ '% s \' not \ '% s
\' \ &. \ at",
             id, hostname);
    else
      printf ( "The certificate was not issued for \ '% s \' \ in", hostname);
  )

  if (failures & NE_SSL_UNTRUSTED)
    puts ( "The certificate is not signed by a trusted Certificate
Authority \ &.");

  / * \ &. \ &. \ &. check for validity failures \ &. \ &. \ &. * /

  if (prompt_user ())
    return 1; / * fail verification * /
  else
    return 0; / * trust the certificate anyway * /
)

But I don't know how I can implement the function  "prompt_user ()."
What should I do this? In the documentation, I have seen an example of
implementing the "dump_cert," but I do not know what operations to do
the "prompt_user ()."

Thanks.

Rosa




More information about the neon mailing list