[stunnel-users] Can this be done by Stunnel [Nexmo]

Alan C. Bonnici chribonn at gmail.com
Thu Mar 22 10:48:58 CET 2012


Hi,

Nexmo offer (free trial) SMS messages that can be programmed into systems.
I've attached the log file when calling the service:

2012.03.22 10:41:13 LOG7[5024:8232]: No limit detected for the number of
clients
2012.03.22 10:41:13 LOG5[5024:8232]: stunnel 4.53 on x86-pc-mingw32-gnu
platform
2012.03.22 10:41:13 LOG5[5024:8232]: Compiled/running with OpenSSL
0.9.8s-fips 4 Jan 2012
2012.03.22 10:41:13 LOG5[5024:8232]: Threading:WIN32 SSL:+ENGINE+OCSP+FIPS
Auth:none Sockets:SELECT+IPv6
2012.03.22 10:41:13 LOG5[5024:8232]: Reading configuration from file
stunnel.conf
2012.03.22 10:41:14 LOG5[5024:8232]: FIPS mode is enabled
2012.03.22 10:41:14 LOG7[5024:8232]: Compression not enabled
2012.03.22 10:41:14 LOG7[5024:8232]: Snagged 64 random bytes from C:/.rnd
2012.03.22 10:41:14 LOG7[5024:8232]: Wrote 1024 new random bytes to C:/.rnd
2012.03.22 10:41:14 LOG7[5024:8232]: PRNG seeded successfully
2012.03.22 10:41:14 LOG6[5024:8232]: Initializing service section [nexmo]
2012.03.22 10:41:14 LOG7[5024:8232]: Certificate: stunnel.pem
2012.03.22 10:41:14 LOG7[5024:8232]: Certificate loaded
2012.03.22 10:41:14 LOG7[5024:8232]: Key file: stunnel.pem
2012.03.22 10:41:14 LOG7[5024:8232]: Private key loaded
2012.03.22 10:41:14 LOG7[5024:8232]: SSL options set: 0x01000004
2012.03.22 10:41:14 LOG5[5024:8232]: Configuration successful
2012.03.22 10:41:14 LOG7[5024:8232]: Service [nexmo] (FD=280) bound to
0.0.0.0:9012
2012.03.22 10:44:09 LOG7[5024:8232]: Service [nexmo] accepted (FD=444) from
127.0.0.1:3692
2012.03.22 10:44:09 LOG7[5024:8232]: Creating a new thread
2012.03.22 10:44:09 LOG7[5024:8232]: New thread created
2012.03.22 10:44:09 LOG7[5024:3280]: Service [nexmo] started
2012.03.22 10:44:09 LOG5[5024:3280]: Service [nexmo] accepted connection
from 127.0.0.1:3692
2012.03.22 10:44:09 LOG6[5024:3280]: connect_blocking: connecting
174.120.166.82:443
2012.03.22 10:44:09 LOG7[5024:3280]: connect_blocking: s_poll_wait
174.120.166.82:443: waiting 10 seconds
2012.03.22 10:44:09 LOG5[5024:3280]: connect_blocking: connected
174.120.166.82:443
2012.03.22 10:44:09 LOG5[5024:3280]: Service [nexmo] connected remote server
from 10.252.0.51:3693
2012.03.22 10:44:09 LOG7[5024:3280]: Remote socket (FD=476) initialized
2012.03.22 10:44:10 LOG7[5024:3280]: Peer certificate was cached (6499
bytes)
2012.03.22 10:44:10 LOG6[5024:3280]: SSL connected: new session negotiated
2012.03.22 10:44:10 LOG6[5024:3280]: Negotiated TLSv1/SSLv3 ciphersuite:
AES256-SHA (256-bit encryption)
2012.03.22 10:44:10 LOG6[5024:3280]: Compression: null, expansion: null
2012.03.22 10:44:10 LOG7[5024:3280]: SSL closed on SSL_read
2012.03.22 10:44:10 LOG7[5024:3280]: Sent socket write shutdown
2012.03.22 10:44:10 LOG7[5024:3280]: Socket closed on read
2012.03.22 10:44:10 LOG7[5024:3280]: Sending close_notify alert
2012.03.22 10:44:10 LOG6[5024:3280]: SSL_shutdown successfully sent
close_notify alert
2012.03.22 10:44:10 LOG5[5024:3280]: Connection closed: 388 byte(s) sent to
SSL, 200 byte(s) sent to socket
2012.03.22 10:44:10 LOG7[5024:3280]: Remote socket (FD=476) closed
2012.03.22 10:44:10 LOG7[5024:3280]: Local socket (FD=444) closed
2012.03.22 10:44:10 LOG7[5024:3280]: Service [nexmo] finished (0 left)
2012.03.22 10:44:10 LOG7[5024:8232]: Service [nexmo] accepted (FD=440) from
127.0.0.1:3694
2012.03.22 10:44:10 LOG7[5024:8232]: Creating a new thread
2012.03.22 10:44:10 LOG7[5024:8232]: New thread created
2012.03.22 10:44:10 LOG7[5024:8864]: Service [nexmo] started
2012.03.22 10:44:10 LOG5[5024:8864]: Service [nexmo] accepted connection
from 127.0.0.1:3694
2012.03.22 10:44:10 LOG6[5024:8864]: connect_blocking: connecting
174.120.166.82:443
2012.03.22 10:44:10 LOG7[5024:8864]: connect_blocking: s_poll_wait
174.120.166.82:443: waiting 10 seconds
2012.03.22 10:44:10 LOG5[5024:8864]: connect_blocking: connected
174.120.166.82:443
2012.03.22 10:44:10 LOG5[5024:8864]: Service [nexmo] connected remote server
from 10.252.0.51:3695
2012.03.22 10:44:10 LOG7[5024:8864]: Remote socket (FD=424) initialized
2012.03.22 10:44:10 LOG6[5024:8864]: SSL connected: previous session reused
2012.03.22 10:44:10 LOG7[5024:8864]: SSL closed on SSL_read
2012.03.22 10:44:10 LOG7[5024:8864]: Sent socket write shutdown
2012.03.22 10:44:10 LOG7[5024:8864]: Socket closed on read
2012.03.22 10:44:10 LOG7[5024:8864]: Sending close_notify alert
2012.03.22 10:44:10 LOG6[5024:8864]: SSL_shutdown successfully sent
close_notify alert
2012.03.22 10:44:10 LOG5[5024:8864]: Connection closed: 269 byte(s) sent to
SSL, 200 byte(s) sent to socket
2012.03.22 10:44:10 LOG7[5024:8864]: Remote socket (FD=424) closed
2012.03.22 10:44:10 LOG7[5024:8864]: Local socket (FD=440) closed
2012.03.22 10:44:10 LOG7[5024:8864]: Service [nexmo] finished (0 left)
2012.03.22 10:44:10 LOG7[5024:8232]: Service [nexmo] accepted (FD=460) from
127.0.0.1:3696
2012.03.22 10:44:10 LOG7[5024:8232]: Creating a new thread
2012.03.22 10:44:10 LOG7[5024:8232]: New thread created
2012.03.22 10:44:10 LOG7[5024:5820]: Service [nexmo] started
2012.03.22 10:44:10 LOG5[5024:5820]: Service [nexmo] accepted connection
from 127.0.0.1:3696
2012.03.22 10:44:10 LOG6[5024:5820]: connect_blocking: connecting
174.120.166.82:443
2012.03.22 10:44:10 LOG7[5024:5820]: connect_blocking: s_poll_wait
174.120.166.82:443: waiting 10 seconds
2012.03.22 10:44:11 LOG5[5024:5820]: connect_blocking: connected
174.120.166.82:443
2012.03.22 10:44:11 LOG5[5024:5820]: Service [nexmo] connected remote server
from 10.252.0.51:3697
2012.03.22 10:44:11 LOG7[5024:5820]: Remote socket (FD=476) initialized
2012.03.22 10:44:11 LOG6[5024:5820]: SSL connected: previous session reused
2012.03.22 10:44:11 LOG7[5024:5820]: SSL closed on SSL_read
2012.03.22 10:44:11 LOG7[5024:5820]: Sent socket write shutdown
2012.03.22 10:44:11 LOG7[5024:5820]: Socket closed on read
2012.03.22 10:44:11 LOG7[5024:5820]: Sending close_notify alert
2012.03.22 10:44:11 LOG6[5024:5820]: SSL_shutdown successfully sent
close_notify alert
2012.03.22 10:44:11 LOG5[5024:5820]: Connection closed: 299 byte(s) sent to
SSL, 200 byte(s) sent to socket
2012.03.22 10:44:11 LOG7[5024:5820]: Remote socket (FD=476) closed
2012.03.22 10:44:11 LOG7[5024:5820]: Local socket (FD=460) closed
2012.03.22 10:44:11 LOG7[5024:5820]: Service [nexmo] finished (0 left)
2012.03.22 10:44:11 LOG7[5024:8232]: Service [nexmo] accepted (FD=448) from
127.0.0.1:3698
2012.03.22 10:44:11 LOG7[5024:8232]: Creating a new thread
2012.03.22 10:44:11 LOG7[5024:8232]: New thread created
2012.03.22 10:44:11 LOG7[5024:8476]: Service [nexmo] started
2012.03.22 10:44:11 LOG5[5024:8476]: Service [nexmo] accepted connection
from 127.0.0.1:3698
2012.03.22 10:44:11 LOG6[5024:8476]: connect_blocking: connecting
174.120.166.82:443
2012.03.22 10:44:11 LOG7[5024:8476]: connect_blocking: s_poll_wait
174.120.166.82:443: waiting 10 seconds
2012.03.22 10:44:11 LOG5[5024:8476]: connect_blocking: connected
174.120.166.82:443
2012.03.22 10:44:11 LOG5[5024:8476]: Service [nexmo] connected remote server
from 10.252.0.51:3699
2012.03.22 10:44:11 LOG7[5024:8476]: Remote socket (FD=424) initialized
2012.03.22 10:44:11 LOG6[5024:8476]: SSL connected: previous session reused
2012.03.22 10:44:12 LOG7[5024:8476]: SSL closed on SSL_read
2012.03.22 10:44:12 LOG7[5024:8476]: Sent socket write shutdown
2012.03.22 10:44:12 LOG7[5024:8476]: Socket closed on read
2012.03.22 10:44:12 LOG7[5024:8476]: Sending close_notify alert
2012.03.22 10:44:12 LOG6[5024:8476]: SSL_shutdown successfully sent
close_notify alert
2012.03.22 10:44:12 LOG5[5024:8476]: Connection closed: 299 byte(s) sent to
SSL, 200 byte(s) sent to socket
2012.03.22 10:44:12 LOG7[5024:8476]: Remote socket (FD=424) closed
2012.03.22 10:44:12 LOG7[5024:8476]: Local socket (FD=448) closed
2012.03.22 10:44:12 LOG7[5024:8476]: Service [nexmo] finished (0 left)

-----------------------------------

Message: 4
Date: Wed, 21 Mar 2012 15:50:59 +0100
From: "Alan C. Bonnici" <chribonn at gmail.com>
To: <stunnel-users at stunnel.org>
Subject: [stunnel-users] Can this be done by Stunnel
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi, 

I am new to STunnel. I am trying to connect to a service provided by
nexmo.com. 

If from a browser I type the following:

https://rest.nexmo.com/sms/xml?username=xxxxxxx
<https://rest.nexmo.com/sms/xml?username=xxxxxxx&password=xxxxx&from=xxxxxxx
&to=xxxxxxx&text=xxxxxxxxxx>
&password=xxxxx&from=xxxxxxx&to=xxxxxxx&text=xxxxxxxxxx

The process works.

I just installed stunnel and have the following config file 

; Debugging stuff (may useful for troubleshooting)
;debug = 7
;output = stunnel.log

; Certificate/key is needed in server mode and optional in client mode
cert = stunnel.pem
;key = stunnel.pem

; Disable support for insecure SSLv2 protocol
options = NO_SSLv2

[nexmo]
client = yes 
accept =  9012
connect = rest.nexmo.com:443
TIMEOUTclose = 0

When I type 

http://127.0.0.1:9012/sms/xml?
username=xxxxxxx&password=xxxxx&from=xxxxxxx&to=xxxxxxx&text=xxxxxxxxxx 

it does not.

Can anyone please confirm whether what I am trying to do is doable and maybe
highlight what I am doing wrong.

Regards,
Alan 




More information about the stunnel-users mailing list