Hi there,
I stumbled over the following text in the documented version of the stunnel.conf:
; Microsoft CryptoAPI engine allows for authentication with private keys ; stored in the Windows certificate store ; Each section using this feature also needs the "engineId = capi" option ;engine = capi ; You also need to disable TLS 1.2 or later, because the CryptoAPI engine ; currently does not support PSS ;sslVersionMax = TLSv1.1
Is that still valid? If so, it would explain why TLS > 1.1 fails in my setup.
Cheers Christian Keck
Von: Christian Keck Christian.Keck@macio.de Gesendet: Dienstag, 10. November 2020 09:14 An: stunnel-users@stunnel.org Betreff: [stunnel-users] Re: Stunnel and CAPI engine: Issues after OpenSSL upgrade on server side
Hi Tom, Hi everyone,
thanks for your reply. I tried the settings you posted, but with no luck. The error stays the same: SSL_connect: ssl/ssl_rsa.c:36: error:140C618E:SSL routines:SSL_use_certificate:ca md too weak
I think the only solution is to tweak the openssl.cnf in that way, that it accepts the MD. Changing the SECLEVEL like described here does not work for Stunnel somehow: https://askubuntu.com/questions/1231799/certificate-error-after-upgrade-to-2...https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Faskubuntu.com%2Fquestions%2F1231799%2Fcertificate-error-after-upgrade-to-20-04&data=04%7C01%7Cchristian.keck%40macio.de%7C41ade7c92a464993932f08d88550ae57%7C78024680531b40bea760d205006588f5%7C0%7C0%7C637405928867305783%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=36S3qr3qfXaPKFkh4afvmmUHZY6uMWQnNucu6C2JWRY%3D&reserved=0 It seems to me as if the settings are not used at all. Maybe the openssl.cnf is not used in CAPI mode, or the section "[ default_conf ]" is wrong. If so - what would be the correct label to use here?
Cheers, Christian Keck
Von: Tom (AST) Watson <thomas.3.watson@raytheon.commailto:thomas.3.watson@raytheon.com> Gesendet: Montag, 9. November 2020 21:13 An: Christian Keck <Christian.Keck@macio.demailto:Christian.Keck@macio.de>; stunnel-users@stunnel.orgmailto:stunnel-users@stunnel.org Betreff: RE: Stunnel and CAPI engine: Issues after OpenSSL upgrade on server side
Christian...
You might try the following in your stunnel.conf:
cert = /etc/ssl/certs/stunnel.pem # or equivalent options = NO_SSLv2 options = NO_SSLv3 options = NO_TLSv1 options = NO_TLSv1.1 sslVersion = TLSv1.2 <<<<<
This seemed to work for me, as always YMMV! Good luck.
From: Christian Keck <Christian.Keck@macio.demailto:Christian.Keck@macio.de> Sent: Sunday, November 8, 2020 05:42 To: stunnel-users@stunnel.orgmailto:stunnel-users@stunnel.org Subject: [External] [stunnel-users] Stunnel and CAPI engine: Issues after OpenSSL upgrade on server side
Hi there,
we just upgraded a system that is used as a TLS-proxy for incoming connections using client-ssl-handshake from an old CentOS 6 to a recent Ubuntu LTS. By doing so, the OpenSSL was updated from 1.0.1e to 1.1.1f.
Right after installation, the new OpenSSL complained about "too weak ca cypher", so I had to add a line "CipherString = DEFAULT:@SECLEVEL=1" to the openssl.conf to make things work again. After applying the changes, connections via browsers do work again using TLS 1.3. (We will generate a new host-CA some day, but for now we need a running system)
Before the upgrade, Stunnel in CAPI-mode worked wih TLS 1.2 encryption. Now after updating the server, it refused to connect at all.
Using version 5.56 of Stunnel, I see the following lines in the log:
error queue: ssl/statem/statem_lib.c:298: error:141F0006:SSL routines:tls_construct_cert_verify:EVP lib SSL_connect: engines/e_capi.c:814: error:8006F074:lib(128):capi_rsa_priv_enc:function not supported
If I nail the protocol setting to TLS1.1 in the apache2-config, the connection is possible again with version 5.56.
Any later versions of Stunnel completely refuse to work, I always get lines like:
SSL_read: ssl/ssl_rsa.c:36: error:140C618E:SSL routines:SSL_use_certificate:ca md too weak
I tried several things I found in the net regarding tweaking openssl.conf and/or stunnel.conf, but I can't get it running with version 5.57 or later.
So my questions is: What can I do to get Stunnel working again with at least TLS1.2 (or even better TLS1.3 like I get in most browsers)? Re-generating the host-CA (and thus needing to re-create all client certs) is unfortunately no option for the moment.
Many thanks in advance!
Cheers, Christian Keck