[Help-gnutls] Re: handshake
Martin Knappe
martin.knappe at gmail.com
Tue Nov 4 09:19:47 CET 2008
I'll also post the output of strace; I really don't understand what's going
on here...
write(1, "BEFORE HANDSHAKE\n", 14BEFORE HANDSHAKE
) = 14
gettimeofday({1225793748, 165856}, NULL) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 664041}, ru_stime={0, 0}, ...}) = 0
time(NULL) = 1225793748
times({tms_utime=66, tms_stime=0, tms_cutime=0, tms_cstime=0}) = 1845603364
gettimeofday({1225793748, 167291}, NULL) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 664041}, ru_stime={0, 0}, ...}) = 0
time(NULL) = 1225793748
times({tms_utime=66, tms_stime=0, tms_cutime=0, tms_cstime=0}) = 1845603364
recv(5,
here the client blocks, when it has to do a send instead of a receive!
On Mon, Nov 3, 2008 at 5:39 PM, Martin Knappe <martin.knappe at gmail.com>wrote:
> hi
>
> im having a problem with making a handshake between client and server
> the problem is that my client seems to "think" it is really a server,
> because instead of sending a client hello. it does a receive when initiating
> the handshake (i checked with strace)
> could someone have a look at this snippet and tell me why this client might
> think it is a server:
>
> if (gnutls_init(&session, GNUTLS_CLIENT) != 0) {
> return E_GNUTLS_INIT;
> }
> if (gnutls_set_default_priority(session) != 0) {
> return E_GNUTLS_SET_DEFAULT_PRIORITY;
> }
> if (gnutls_kx_set_priority(session, (const int[]) {GNUTLS_KX_DHE_PSK,
> 0})) {
> return E_GNUTLS_KX_SET_PRIORITY;
> }
> if (gnutls_credentials_set (session, GNUTLS_CRD_PSK, psk_cred) != 0) {
> return E_GNUTLS_CREDENTIALS_SET;
> }
> gnutls_transport_set_ptr(session, (gnutls_transport_ptr_t) sockfd);
> printf("BEFORE
> HANDSHAKE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
> if (gnutls_handshake(session) < 0) {
> return E_HANDSHAKE;
> }
> printf("AFTER
> HANDSHAKE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
> return E_SUCCESS;
>
> when i execute this, I get the message "BEFORE
> HANDSHAKE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", and then my
> client blocks!
>
> many thanks
>
> martin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20081104/4e5aa757/attachment.htm>
More information about the Gnutls-help
mailing list