[stunnel-users] Stunnel 4 failing to connect to gmail

Asif Iqbal vadud3 at gmail.com
Mon Dec 15 21:19:43 CET 2008


On Mon, Dec 15, 2008 at 3:11 PM, Asif Iqbal <vadud3 at gmail.com> wrote:
> On Mon, Dec 15, 2008 at 2:48 PM, Ludolf Holzheid
> <lholzheid at bihl-wiedemann.de> wrote:
>> On Mon, 2008-12-15 14:14:56 -0500, Asif Iqbal wrote:
>>> I am faling to connect to gmail. Not sure what that bind error means.
>>>
>>> [..]
>>>
>>> 2008.12.15 13:53:17 LOG3[3839:3083650736]: Error binding ssmtp to
>>> 74.125.93.111:587
>>> 2008.12.15 13:53:17 LOG3[3839:3083650736]: bind: Cannot assign
>>> requested address (99)
>>
>> Looks to me that either port 587 is already in use on your machine, or
>> 74.125.93.111 is not its IP address.
>>
>>>
>>> Here is how my conf file looks like
>>>
>>> [..]
>>>
>>> [ssmtp]
>>> accept  = smtp.gmail.com:587
>>> connect = 25
>>
>> Ah, o.k., you told stunnel to bind() to gmail and connect() to
>> localhost. This should be the other way 'round: You want stunnel to
>> accept connections from your mail client to localhost at port 25 and
>> then connect to smtp.gmail.com at port 587.
>
> doh!
>
> It is working now.

I said it too soon. It passed that bind error but it still failing in ssl.
I am seeing   `SSL alert (write): fatal: handshake failure'

2008.12.15 15:07:37 LOG7[7614:3084007088]: Snagged 64 random bytes
from /home/iqbala/.rnd
2008.12.15 15:07:37 LOG7[7614:3084007088]: Wrote 1024 new random bytes
to /home/iqbala/.rnd
2008.12.15 15:07:37 LOG7[7614:3084007088]: RAND_status claims
sufficient entropy for the PRNG
2008.12.15 15:07:37 LOG7[7614:3084007088]: PRNG seeded successfully
2008.12.15 15:07:37 LOG7[7614:3084007088]: Certificate: /etc/stunnel/stunnel.pem
2008.12.15 15:07:37 LOG7[7614:3084007088]: Certificate loaded
2008.12.15 15:07:37 LOG7[7614:3084007088]: Key file: /etc/stunnel/stunnel.pem
2008.12.15 15:07:37 LOG7[7614:3084007088]: Private key loaded
2008.12.15 15:07:37 LOG7[7614:3084007088]: SSL context initialized for
service ssmtp
2008.12.15 15:07:37 LOG5[7614:3084007088]: stunnel 4.22 on
i486-pc-linux-gnu with OpenSSL 0.9.8g 19 Oct 2007
2008.12.15 15:07:37 LOG5[7614:3084007088]: Threading:PTHREAD
SSL:ENGINE Sockets:POLL,IPv6 Auth:LIBWRAP
2008.12.15 15:07:37 LOG6[7614:3084007088]: file ulimit = 1024 (can be
changed with 'ulimit -n')
2008.12.15 15:07:43 LOG6[7614:3084007088]: poll() used - no FD_SETSIZE
limit for file descriptors
2008.12.15 15:07:43 LOG5[7614:3084007088]: 500 clients allowed
2008.12.15 15:07:43 LOG7[7614:3084007088]: FD 10 in non-blocking mode
2008.12.15 15:07:43 LOG7[7614:3084007088]: FD 11 in non-blocking mode
2008.12.15 15:07:43 LOG7[7614:3084007088]: FD 12 in non-blocking mode
2008.12.15 15:07:43 LOG7[7614:3084007088]: SO_REUSEADDR option set on
accept socket
2008.12.15 15:07:43 LOG7[7614:3084007088]: ssmtp bound to 0.0.0.0:25
2008.12.15 15:07:43 LOG7[7614:3084007088]: Created pid file /stunnel4.pid
2008.12.15 20:09:46 LOG7[7614:3084007088]: ssmtp accepted FD=13 from
127.0.0.1:46039
2008.12.15 20:09:46 LOG7[7614:3087547280]: ssmtp started
2008.12.15 20:09:46 LOG7[7614:3087547280]: FD 13 in non-blocking mode
2008.12.15 20:09:46 LOG7[7614:3087547280]: TCP_NODELAY option set on
local socket
2008.12.15 20:09:46 LOG7[7614:3087547280]: Waiting for a libwrap process
2008.12.15 20:09:46 LOG7[7614:3087547280]: Acquired libwrap process #0
2008.12.15 20:09:46 LOG7[7614:3087547280]: Releasing libwrap process #0
2008.12.15 20:09:46 LOG7[7614:3087547280]: Released libwrap process #0
2008.12.15 20:09:46 LOG7[7614:3087547280]: ssmtp permitted by libwrap
from 127.0.0.1:46039
2008.12.15 20:09:46 LOG5[7614:3087547280]: ssmtp accepted connection
from 127.0.0.1:46039
2008.12.15 20:09:46 LOG7[7614:3087547280]: FD 14 in non-blocking mode
2008.12.15 20:09:46 LOG7[7614:3087547280]: ssmtp connecting 74.125.93.111:587
2008.12.15 20:09:46 LOG7[7614:3087547280]: connect_wait: waiting 10 seconds
2008.12.15 20:09:46 LOG7[7614:3087547280]: connect_wait: connected
2008.12.15 20:09:46 LOG5[7614:3087547280]: ssmtp connected remote
server from 10.13.136.166:47496
2008.12.15 20:09:46 LOG7[7614:3087547280]: Remote FD=14 initialized
2008.12.15 20:09:46 LOG7[7614:3087547280]: TCP_NODELAY option set on
remote socket
2008.12.15 20:09:46 LOG7[7614:3087547280]: SSL state (connect):
before/connect initialization
2008.12.15 20:09:46 LOG7[7614:3087547280]: SSL state (connect): SSLv3
write client hello A
2008.12.15 20:09:46 LOG7[7614:3087547280]: SSL alert (write): fatal:
handshake failure
2008.12.15 20:09:46 LOG3[7614:3087547280]: SSL_connect: 1408F10B:
error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
2008.12.15 20:09:46 LOG5[7614:3087547280]: Connection reset: 0 bytes
sent to SSL, 0 bytes sent to socket
2008.12.15 20:09:46 LOG7[7614:3084007088]: ssmtp accepted FD=13 from
127.0.0.1:46041
2008.12.15 20:09:46 LOG7[7614:3083754384]: ssmtp started
2008.12.15 20:09:46 LOG7[7614:3083754384]: FD 13 in non-blocking mode
2008.12.15 20:09:46 LOG7[7614:3083754384]: TCP_NODELAY option set on
local socket
2008.12.15 20:09:46 LOG7[7614:3083754384]: Waiting for a libwrap process
2008.12.15 20:09:46 LOG7[7614:3083754384]: Acquired libwrap process #0
2008.12.15 20:09:46 LOG7[7614:3083754384]: Releasing libwrap process #0
2008.12.15 20:09:46 LOG7[7614:3087547280]: ssmtp finished (0 left)
2008.12.15 20:09:46 LOG7[7614:3083754384]: Released libwrap process #0
2008.12.15 20:09:46 LOG7[7614:3083754384]: ssmtp permitted by libwrap
from 127.0.0.1:46041
2008.12.15 20:09:46 LOG5[7614:3083754384]: ssmtp accepted connection
from 127.0.0.1:46041
2008.12.15 20:09:46 LOG7[7614:3083754384]: FD 14 in non-blocking mode
2008.12.15 20:09:46 LOG7[7614:3083754384]: ssmtp connecting 74.125.93.109:587
2008.12.15 20:09:46 LOG7[7614:3083754384]: connect_wait: waiting 10 seconds
2008.12.15 20:09:46 LOG7[7614:3083754384]: connect_wait: connected
2008.12.15 20:09:46 LOG5[7614:3083754384]: ssmtp connected remote
server from 10.13.136.166:38962
2008.12.15 20:09:46 LOG7[7614:3083754384]: Remote FD=14 initialized
2008.12.15 20:09:46 LOG7[7614:3083754384]: TCP_NODELAY option set on
remote socket
2008.12.15 20:09:46 LOG7[7614:3083754384]: SSL state (connect):
before/connect initialization
2008.12.15 20:09:46 LOG7[7614:3083754384]: SSL state (connect): SSLv3
write client hello A
2008.12.15 20:09:46 LOG7[7614:3083754384]: SSL alert (write): fatal:
handshake failure
2008.12.15 20:09:46 LOG3[7614:3083754384]: SSL_connect: 1408F10B:
error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
2008.12.15 20:09:46 LOG5[7614:3083754384]: Connection reset: 0 bytes
sent to SSL, 0 bytes sent to socket

>
> Thanks a lot
>
>>
>> HTH,
>>
>> Ludolf
>>
>> --
>>
>> ---------------------------------------------------------------
>> Ludolf Holzheid             Tel:    +49 621 339960
>> Bihl+Wiedemann GmbH         Fax:    +49 621 3392239
>> Floßwörthstraße 41          e-mail: lholzheid at bihl-wiedemann.de
>> D-68199 Mannheim, Germany
>> ---------------------------------------------------------------
>>
>>
>
>
>
> --
> Asif Iqbal
> PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
>



-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu



More information about the stunnel-users mailing list