Server Credentials: x509 cert and key

Alvaro Lopez Ortega alvaro at
Thu Aug 21 23:17:56 CEST 2008

Hello there,

I have a quick question for you guys, I hope someone can give me a hand 
with this. The thing is that I do not know how to access the X509 cert 
and key from within a gnutls_certificate_server_credentials object.

Allow me to summarize the problem. All this is happening in a server; I 
create one of the certificate_server_credentials structures for each 
virtual server and then, I read the key and cert for each of them by 
calling the gnutls_certificate_set_x509_key_file() function.

Right after that, gnutls_certificate_server_set_retrieve_function() sets 
the SNI callback from which I can access the virtual server credentials 
that I'd like the TLS connection to use. However, there is where it gets 
kind of confusing to me.

How am I supposed to set the cert.x509 and key.x509 values in the 
gnutls_retr_st structure?  Is there a way to get those values by using 
the certificate server credential object?


Greetings, alo

More information about the Gnutls-devel mailing list