You are right, now it works :-)

The stunnel should have been the server, but was configured as client.

Thankyou for your help.

[EMAIL PROTECTED] ha scritto:
Hello,
  
I need to make an SSL connectione between a client and a server 
application, both developed by me.
On the server side I am going to use stunnel, while on the client side I 
    

  
can't use stunnel, I must use the ssl library.

I tried to write the code to do it, but I can't connect.
This is the output of stunnel:

2008.02.04 17:30:48 LOG7[6385:1077001280]: kstunnel accepted FD=6 from 
127.0.0.1:33208
2008.02.04 17:30:48 LOG7[6385:1077070768]: kstunnel started
2008.02.04 17:30:48 LOG7[6385:1077070768]: FD 6 in non-blocking mode
2008.02.04 17:30:48 LOG7[6385:1077070768]: FD 7 in non-blocking mode
2008.02.04 17:30:48 LOG7[6385:1077070768]: FD 8 in non-blocking mode
2008.02.04 17:30:48 LOG7[6385:1077070768]: Connection from 
127.0.0.1:33208 permitted by libwrap
2008.02.04 17:30:48 LOG5[6385:1077070768]: kstunnel connected from 
127.0.0.1:33208
2008.02.04 17:30:48 LOG7[6385:1077070768]: FD 7 in non-blocking mode
2008.02.04 17:30:48 LOG7[6385:1077070768]: kstunnel connecting 
192.168.0.180:3000
2008.02.04 17:30:48 LOG7[6385:1077070768]: connect_wait: waiting 10 
    
seconds
  
2008.02.04 17:30:48 LOG7[6385:1077070768]: connect_wait: connected
2008.02.04 17:30:48 LOG7[6385:1077070768]: Remote FD=7 initialized
2008.02.04 17:30:48 LOG7[6385:1077070768]: SSL state (connect): 
before/connect initialization
2008.02.04 17:30:48 LOG7[6385:1077001280]: Cleaning up the signal pipe
2008.02.04 17:30:48 LOG6[6385:1077001280]: Child process 6550 finished 
with code 0
2008.02.04 17:30:48 LOG7[6385:1077070768]: SSL state (connect): SSLv3 
write client hello A
2008.02.04 17:30:48 LOG7[6385:1077070768]: SSL alert (write): fatal: 
unexpected_message
2008.02.04 17:30:48 LOG3[6385:1077070768]: SSL_connect: 14092072: 
error:14092072:SSL routines:SSL3_GET_SERVER_HELLO:bad message type
2008.02.04 17:30:48 LOG5[6385:1077070768]: Connection reset: 0 bytes 
sent to SSL, 0 bytes sent to socket
2008.02.04 17:30:48 LOG7[6385:1077070768]: kstunnel finished (0 left)


I would like to know where to find sample C code to make an SSL 
connection to an stunnel server (better if with and without certificate 
verification).
    
I do not know stunnel but from this messages this looks like this 
application
has bad configuration because it behaves like client - not server.
To be sure try to connect with:
        $ openssl s_client -connect ip:port -debug -msg

Best regards,
--
Marek Marcola <[EMAIL PROTECTED]>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]


  
______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]

Reply via email to