Using a Callback to Select the Certificate to Use (error)
Pedro Pereira
pedro.pereira at tut.fi
Mon Nov 15 20:12:14 CET 2010
Hi,
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`
or
$ gcc -o client ex-cert-select.c tcp.c -lgnutls
output:
/tmp/ccpq7pJM.o: In function `cert_callback':
ex-cert-select.c:(.text+0x667): undefined reference to
`gnutls_sign_algorithm_get_requested'
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=http://www.cacert.org,CN=CA Cert Signing
Authority,EMAIL=support at cacert.org
[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 thawte.com
./client: relocation error: ./client: symbol
gnutls_sign_algorithm_get_requested, version GNUTLS_2_10 not defined
in file libgnutls.so.26 with link time reference
...and the program aborts.
What's happening here? Can someone help me to understand how to make
this work normally?
Regards,
Pedro
More information about the Gnutls-help
mailing list