[Help-gnutls] Sending a client certificate

Martin Lambers marlam at web.de
Sat Feb 5 16:26:21 CET 2005


I'm trying to send a client certificate when starting a TLS handshake
with a server. 
Currently, I use the following steps (plus error checking, of course):

gnutls_init(&session, GNUTLS_CLIENT);
gnutls_set_default_priority(session);
gnutls_certificate_allocate_credentials(&cred);
gnutls_certificate_set_x509_key_file(cred, 
    "cert_file.pem", "key_file.pem", GNUTLS_X509_FMT_PEM);
gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, cred);
gnutls_transport_set_ptr(session, fd);
gnutls_handshake(session);

But this does not work; no client certificate is send. Are there more
steps necessary? Am I missing something?

I used both GnuTLS 1.0.17 and 1.2.0.

Martin





More information about the Gnutls-help mailing list