Dear stunnel managers,
I would like to inform you that there exist some incompatibility with
stunnel and openssl pkcs11-engine with external PIN entry device (like
RSA smartcard using opensc) in Linux.
We use this config to load openssl engine stunnel.conf:
---
engine=dynamic
engineCtrl=SO_PATH:/usr/lib/engines/engine_pkcs11.so
engineCtrl=ID:pkcs11
engineCtrl=LIST_ADD:1
engineCtrl=LOAD
engineCtrl=MODULE_PATH:/usr/lib/opensc-pkcs11.so
engineCtrl=INIT
---
Problem is, with this setup stunnel …
[View More]does not allow user to enter PIN for
the secret key.
Instead it tries to get secret key without PIN, 3 times (and then
therefore usually blocks card PIN) and retires:
----
Initializing engine 1
Engine 1 initialized
PRNG seeded successfully
Certificate: mart.pem
Certificate loaded
Key file: id_01
error queue: 26096080 : error:26096080:engine
routines:ENGINE_load_private_key:failed loading private key
error queue: 800050A0 : error:800050A0:PKCS11 library:PKCS11_login:PIN
incorrect
Wrong PIN: retrying
error queue: 26096080 : error:26096080:engine
routines:ENGINE_load_private_key:failed loading private key
error queue: 800050A0 : error:800050A0:PKCS11 library:PKCS11_login:PIN
incorrect
Wrong PIN: retrying
error queue: 26096080 : error:26096080:engine
routines:ENGINE_load_private_key:failed loading private key
ENGINE_load_private_key: 800050A0: error:800050A0:PKCS11
library:PKCS11_login:PIN incorrect
----
I discovered workaround that is valid form version 4.26 till current
4.34, as follows, NULL-ing the ui_data.method property in ctx.c:
---
diff -cr stunnel-4.34/src/ctx.c stunnel-4.34-patched/src/ctx.c
*** stunnel-4.34/src/ctx.c 2010-09-14 18:08:43.000000000 +0300
--- stunnel-4.34-patched/src/ctx.c 2010-09-28 21:56:36.219081931 +0300
***************
*** 304,309 ****
--- 304,310 ----
UI_method_set_reader(ui_method, pin_cb);
#else /* USE_WIN32 */
ui_method=UI_OpenSSL();
+ ui_data.section = NULL;
#endif /* USE_WIN32 */
if(section->engine)
for(i=1; i<=3; i++) {
---
After that patch private key loads correctly:
---
Initializing engine 1
Engine 1 initialized
PRNG seeded successfully
Certificate: mart.pem
Certificate loaded
Key file: id_01
private key loaded
---
It would be nice if:
* somebody investigates more precisely why the OpenSSL PIN entry is not
showing with unpached stunnel
* include my or better patch for this situation
Thank you very much for excellent piece of software!
With best regards,
Märt Laak
[View Less]
The configuration files are :
pid = /var/stunnel.pid
;chroot = /var/lib/stunnel
setuid = nobody
setgid = nobody
foreground =yes
; Use it for client mode
client = yes
; Service-level configuration
[pop3s]
accept = 995
connect = 110
[imaps]
accept = 993
connect = 143
[ssmtp]
accept = 465
connect = 25
[mysqls]
accept = 3307
connect = 192.168.1.6:3307
On 192.168.1.6
----------------------
pid = /var/stunnel.pid
setuid =nobody
setgid = nobody
foreground = yes
client = no
; Service-…
[View More]level configuration
[pop3s]
accept = 995
connect = 110
[imaps]
accept = 993
connect = 143
[ssmtp]
accept = 465
connect = 25
[mysqls]
accept =3307
connect =3306
connecting like
/usr/local/mysql/bin/mysql -h 127.0.0.1 -u root -p -P 3307
Enter password:
On entring password the following lines appear :
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 104
Subrata
----- Original Message -----
From: Brian Hatch <bri(a)stunnel.org>
To: subrata(a)indiatimes.com
Sent: Sun, 7 Oct 2007 10:02:17 +0530 (IST)
Subject: Re: [stunnel-users] Stunnel on the same machine
Near 2007-10-05 22:17 +0530, subrata(a)indiatimes.com insisted:
> After starting stunnel and connecting the mysql client/usr/local/mysql/bin/mysql -h 127.0.0.1 -u root -p the flow gets stuck at the Enter password prompt any suggestions how to proceed from there.
What do your stunnel configuration files look like?
Other problem: mysql client may decide to use a local domain socket when
connecting to localhost, thwarting your attempts to go via Stunnel.
You might want to 'strace mysql ...' and look for the connect() lines.
--
Brian Hatch Time flies like an
Systems and arrow. Fruit flies
Security Engineer like a banana.
http://www.ifokr.org/bri/
Every message PGP signed
--
My life has changed. What about yours?
Log on to the new Indiatimes Mail and Live out of the Inbox!
[View Less]
The ChangeLog entry:
Version 4.33, 2010.04.05, urgency: MEDIUM:
* New features
- Win32 DLLs for OpenSSL 1.0.0.
This library requires to c_rehash CApath/CRLpath directories on upgrade.
- Win32 DLLs for zlib 1.2.4.
- Experimental support for local mode on WIN32 platform.
Try "exec = c:\windows\system32\cmd.exe".
* Bugfixes
- Inetd mode fixed
SHA-1 value for stunnel-4.33.tar.gz:
695c7ef834952cb8ddbc790e10b6e32798fc2767
Home page: http://stunnel.mirt.net/
Download: ftp://stunnel.…
[View More]mirt.net/stunnel/
Best regards,
Michal Trojnara
[View Less]
Hi,
>From what I read the examples in stunnel site it possible to wrap VPN's
using Stunnel tool.
Is it possible to do it for openvpn packets?
I can configure thru the openvpn configurations that it packets will go thru
port 80 and use TCP but the packets are not http pure. I need to wrap this
packets using the stunnel tool.
The purpose is to use openvpn over http.
I will appreceate if someone can give me a solution for combinig Stunnel and
openvpn if possible.
Thanks
--
View this …
[View More]message in context: http://old.nabble.com/How-to-define-stunnel.conf-so-openvpn-packet-will-go-…
Sent from the Stunnel - Users mailing list archive at Nabble.com.
[View Less]
Hi,
I understand that it is possible to wrap VPN's using Stunnel tool.
How Can I do that for openvpn.
The purpose is to use openvpn over http like.
OpenVPN can establish an HTTP connection to a proxy server, where it will
issue a CONNECT to establish a binary connection to the VPN server on port
443/TCP. This works in 99,9% but not in this case since I am talking about a
very restrictive network but yet Skype for example works on it since it
works in a way of http like.
I will …
[View More]appreceate if someone can give me a solution for combinig Stunnel and
openvpn or other tool if possible.
Thanks
--
View this message in context: http://old.nabble.com/Is-it-possible-to-wrap-openvpn-thru-stunnel-to-HTTP-L…
Sent from the Stunnel - Users mailing list archive at Nabble.com.
[View Less]
Hi All,
I need to understand how can we calculate the throughput for stunnel based on allocated CPU and memory.
For e.g if we allocate 512Mb of RAM and 1 core for the stunnel in Vmware, what would be the throughput in Mbps.
Regards,
Avinash gaonkar
Hello,
I would suggest to improve 'transparent = yes | no (Unix only)'
section of http://www.stunnel.org/faq/stunnel.html#service_level_options
and how this option work on OS X.
I think that this part
remote mode (I<connect> option) on Linux >=2.6.28
remote mode (I<connect> option) 2.2.x
local mode (I<exec> option)
is not clear. Remote mode is a "I<connect> option"? What the heck? And
local mode is a "I<exec> option"? Does this "I" thingie stand for
unnamed …
[View More]pipe or capital "i" or small cap "L"??
I ran to this problem when I tried to set up stunnel on Mac OS X and
carelessly used some example config on web.
Setting "transparent = yes" in Mac OS X will result in very funny
behavior. Consider this conf
debug=7
output=stunnel.log
verify=0
foreground=yes
client=yes
pid=
[https]
accept=localhost:8080
connect=google.com:443
transparent=yes
will result in unbelievable error - "local_bind (original port):
Address family not supported by protocol family (47)"
Using 127.0.0.1 instead of localhost will do better - "Service https
bound to 127.0.0.1:8080" - BUT when you try to access 127.0.0.1:8080
nothing reasonable happens and log will show another strange error
"connect_blocking: connect <ip_address>: Network is unreachable (51)"
The next spectacular thing is that when you use only localhost connect
and accept parameter, than transparent=yes works OK.
I would suggest rewriting that part to reflect these kind of
situations in more clear way - they are very hard to debug, and
honestly I couldn't figure it out even though I read FAQ several
times.
Final question - is it possible on OS X (which doesn't have iptables
interface, but has ipfw) to set up transparent proxy tunnel with
stunnel?
Thanks.
[View Less]
Hello, we were using Stunnel 4.25 for a long time without any
problems.
We used "verify=3". Our client config file:
service = stunnel-client
cert = client.pem
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
verify = 3
CApath = certificates
CAfile = CAcert.pem
client = yes
[rdp]
accept = 3398
connect = XX.XX.XX.XX:3398
But after switching to Stunnel 4.34 (preserving configuration) we
started to get errors:
2010.11.25 13:13:30 LOG5[8332:5336]: Service rdp-database accepted …
[View More]connection from 127.0.0.1:30082
2010.11.25 13:13:30 LOG5[8332:5336]: connect_blocking: connected 95.130.236.42:3398
2010.11.25 13:13:30 LOG5[8332:5336]: Service rdp-database connected
remote server from XX.XX.XX.XX:30083
2010.11.25 13:13:30 LOG5[8332:5336]: Certificate accepted: depth=1,
/C=UA/ST=Lviv/L=Lviv region/O=ROSS/OU=IT/emailAddress=bla(a)bla.com
2010.11.25 13:13:30 LOG4[8332:5336]: CERT: Certificate not found in local repository
2010.11.25 13:13:30 LOG4[8332:5336]: Certificate check failed:
depth=0, /C=UA/ST=Lviv/L=Lviv
region/O=ROSS/OU=IT/CN=OURSERVER/emailAddress=bala(a)bla.com
2010.11.25 13:13:30 LOG3[8332:5336]: SSL_connect: 14090086: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
2010.11.25 13:13:30 LOG5[8332:5336]: Connection reset: 0 bytes sent to SSL, 0 bytes sent to socket
Main error is:
CERT: Certificate not found in local repository
Looks like stunnel cannot find the hashed server's certificate in
C:\Program Files\stunnel\certificates (CApath = certificates)
We tried specifying full paths, but it does not help. Switching to
"verify=2" (do not check server's cert) works ok. Also stunnel 4.25
(with verify=3) works ok on this configuration.
Could you help?
Ross
[View Less]
On 11/25/2010 05:42 AM, Joe Williams wrote:
>
> Got it, so there's no way to configure stunnel to disable it without building a new openssl from source. I was thinking there might be an SSL option I could pass in.
>
That kind of feature was only introduced into the newer versions of
OpenSSL, so by definition, older versions can't have an option to
disable it ;-)
FYI I still have to run fully patched Apache with
"SSLInsecureRenegotiation on" due to MSIE still not supporting proper
…
[View More]optional client cert renegotiation. It's only *2 years* since the
vulnerability was discovered...
(Chrome, Firefox are fine of course)
--
Cheers
Jason Haar
Information Security Manager, Trimble Navigation Ltd.
Phone: +64 3 9635 377 Fax: +64 3 9635 417
PGP Fingerprint: 7A2E 0407 C9A6 CAF6 2B9F 8422 C063 5EBB FE1D 66D1
[View Less]