Using a Callback to Select the Certificate to Use (error)

Pedro Pereira pedro.pereira at
Mon Nov 15 20:12:14 CET 2010


I am trying to use a callback to select the certificates, but it seems  
that I am having problems compiling the gnutls example that uses  
callback to select the certificates.

$ gcc -o client ex-cert-select.c tcp.c `pkg-config gnutls --cflags --libs`
$ gcc -o client ex-cert-select.c tcp.c -lgnutls

/tmp/ccpq7pJM.o: In function `cert_callback':
ex-cert-select.c:(.text+0x667): undefined reference to  
collect2: ld returned 1 exit status

gnutls_sign_algorithm_get_requested seems to be part of the gnutls.h,  
so it should be reachable with the #define and with the gnutls lib.

Then I tried to use the gnutls-extra lib instead, and it compiles!?  
Strange...but even like that I have problems running the binary:

$ gcc ex-cert-select.c tcp.c -o client -lgnutls-extra
$ ./client
- Server's trusted authorities:
    [0]: CN=GnuTLS test CA
    [1]: O=Root CA,OU=,CN=CA Cert Signing  
Authority,EMAIL=support at
    [2]: C=ZA,ST=Western Cape,L=Cape Town,O=Thawte  
Consulting,OU=Certification Services Division,CN=Thawte Personal  
Freemail CA,EMAIL=personal-freemail at
./client: relocation error: ./client: symbol  
gnutls_sign_algorithm_get_requested, version GNUTLS_2_10 not defined  
in file with link time reference

...and the program aborts.
What's happening here? Can someone help me to understand how to make  
this work normally?


More information about the Gnutls-help mailing list