[Help-gnutls] Re: ex-client-srp and ex-serv-srp

Simon Josefsson simon at josefsson.org
Thu Apr 26 16:21:31 CEST 2007


The error message is a bit sub-optimal, I think you'll get this error if
there a problem with the credentials (e.g., the file is in the wrong
directory, cannot be read, or bad format or similar).  The reasons for
why that happens is a long story, and probably the examples could be
improved here..

Btw, was it difficult to build the examples using VS?  Are you using the
official GnuTLS DLL, or did you build GnuTLS from source too?

/Simon

"Diptikalyan Saha" <diptikalyan at gmail.com> writes:

> Well I found a workaround to the problem. The same source when compiler with
> Visual Studio works perfectly..I guess the problem of length comes due to
> compilation in cygwin.
>
> Thanks
> Diptikalyan.
>
>
> On 4/25/07, Diptikalyan Saha <diptikalyan at gmail.com> wrote:
>>
>> Hi,
>>       I am new to GnuTLS. I installed GnuTLS 1.7.8 on windows XP, and
>> tried to compile&run ex-client-srp.c and ex-serv-srp.c in examples
>> directory and got "handshake failed" error.
>>
>> Heres what I did (using cygwin)
>>
>>
>> $srptool --create-conf tpasswd.conf
>> $srptool --passwd tpasswd --passwd-conf tpasswd.conf -u user
>>   password: pass
>> $srptool --passwd tpasswd --passwd-conf tpasswd.conf --verify -u user
>>
>> $certtool --generate-privkey > x509-ca-key.pem
>> $echo 'cn = GnuTLS test CA' > ca.tmpl
>> $echo 'ca' >> ca.tmpl
>> $echo 'cert_signing_key' >> ca.tmpl
>> $certtool --generate-self-signed --load-privkey x509-ca-key.pem \
>> --template ca.tmpl --outfile x509-ca.pem
>> $certtool --generate-privkey > x509-server-key.pem
>> $echo 'organization = GnuTLS test server' > server.tmpl
>> $echo 'cn = test.gnutls.org' >> server.tmpl
>> $echo 'tls_www_server' >> server.tmpl
>> $echo 'encryption_key' >> server.tmpl
>> $echo 'signing_key' >> server.tmpl
>> $certtool --generate-certificate --load-privkey x509-server-key.pem \
>> --load-ca-certificate x509-ca.pem --load-ca-privkey x509-ca-key.pem \
>> --template server.tmpl --outfile x509-server.pem
>>
>> Changed the three lines of code in ex-serv-srp.c
>> to
>> #define KEYFILE "x509-server-key.pem"
>> #define CERTFILE "x509-server.pem"
>> #define CAFILE "x509-ca.pem"
>>
>> and
>> in ex-client-srp.c
>> #define CAFILE "x509-ca.pem"
>>
>> The I compiled both the files and ran it and I got the following error:
>>
>> $./srv.exe
>> cho Server ready. Listening to port '5556'.
>>  connection from 127.0.0.1, port 2076
>> ** Handshake has failed (A TLS packet with unexpected length was
>> received.)
>>
>> $ ./cli.exe
>> *** Handshake failed
>>
>> Please help me in this regard.
>>
>>
>>
>> Thanks
>>
>> Dipti.
>>
>>
>>
> _______________________________________________
> Help-gnutls mailing list
> Help-gnutls at gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnutls





More information about the Gnutls-help mailing list