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 <[EMAIL PROTECTED]> 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
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gnutls

Reply via email to