{Resolved} openssl new versions consider md certificates too weak

Scripts to manage certificates or generate config files

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Locked
hakster
OpenVpn Newbie
Posts: 1
Joined: Wed Apr 26, 2017 2:52 pm

{Resolved} openssl new versions consider md certificates too weak

Post by hakster » Wed Apr 26, 2017 3:01 pm

A user who upgraded openssl from 1.02 to 1.1.0 found that openvpn could not connect. Seems openssl does not allow md5 signed certificates. Assuming the server certs cannot get re-issued with SHA (easily), is there a workaround, such as relaxing openssl 1.1.0, short of a revert to the older version?

Relevant logging:

nm-openvpn[4287]: library versions: OpenSSL 1.1.0e 16 Feb 2017, LZO 2.10
nm-openvpn[4287]: OpenSSL: error:140AB18E:SSL routines:SSL_CTX_use_certificate:ca md too weak
nm-openvpn[4287]: Cannot load certificate file /path/cert.crt

ku4eto
OpenVpn Newbie
Posts: 2
Joined: Sat Jul 01, 2017 11:28 am

Re: openssl new versions consider md certificates too weak

Post by ku4eto » Sat Jul 01, 2017 11:36 am

I ran into this issue as well. Using Cyberoam certs, it worked a month ago, but after updating, doesnt even try to connect. Logs below.
14:31 OpenVPN 2.5-icsopenvpn [git:icsopenvpn-d51333c645c12713+] android-14-armeabi-v7a [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Jun 26 2017
14:31 library versions: OpenSSL 1.1.0f 25 May 2017, LZO 2.10
14:31 MGMT: Got unrecognized command>FATAL:Cannot load inline certificate file
14:31 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
14:31 OpenSSL: error:140AB18E:SSL routines:SSL_CTX_use_certificate:ca md too weak
14:31 OpenSSL reproted a certificate with a weak hash, please the in app FAQ about weak hashes
14:31 Cannot load inline certificate file
14:31 Exiting due to fatal error

It would be good if we get a fix for this.

Curtj
OpenVpn Newbie
Posts: 1
Joined: Wed Jul 05, 2017 1:05 am

Re: openssl new versions consider md certificates too weak

Post by Curtj » Wed Jul 05, 2017 1:20 am

I had this problem with the OpenVPN for Android app. See the explanation in the following link.
http://ics-openvpn.blinkt.de/FAQ.html

I circumvented/fixed the problem by editing the openssl-1.0.0.cnf file in my easy-rsa directory and changing "default_md" from md5 to sha256 and then regenerating my certificates.

ku4eto
OpenVpn Newbie
Posts: 2
Joined: Sat Jul 01, 2017 11:28 am

Re: openssl new versions consider md certificates too weak

Post by ku4eto » Tue Jul 11, 2017 6:23 am

Curtj wrote:I had this problem with the OpenVPN for Android app. See the explanation in the following link.
http://ics-openvpn.blinkt.de/FAQ.html

I circumvented/fixed the problem by editing the openssl-1.0.0.cnf file in my easy-rsa directory and changing "default_md" from md5 to sha256 and then regenerating my certificates.
Perfect, in the FAQ there is actually information how to go around it:
tls-cipher "DEFAULT:@SECLEVEL=0"
In the advanced > custom settings.
Good solution, when you cant re-issue the certificates. Thanks a bunch.

DoubleSpeed
OpenVpn Newbie
Posts: 2
Joined: Wed Apr 18, 2018 6:24 pm

Re: openssl new versions consider md certificates too weak

Post by DoubleSpeed » Wed Apr 18, 2018 6:31 pm

Having difficulty connecting to my VPN and troubleshooting this I came across this post, I've added:

tls-cipher "DEFAULT:@SECLEVEL=0"
remote-cert-tls server

To my config it now kind of connects, however, keeps reconnecting/refreshing my logs says...

Wed Apr 18 19:21:21 2018 us=97512 No valid translation found for TLS cipher '@SECLEVEL=0'
Wed Apr 18 19:21:21 2018 us=98512 LZO compression initializing
Wed Apr 18 19:21:21 2018 us=98512 Control Channel MTU parms [ L:1654 D:1212 EF:38 EB:0 ET:0 EL:3 ]
Wed Apr 18 19:21:21 2018 us=98512 Data Channel MTU parms [ L:1654 D:1450 EF:122 EB:411 ET:32 EL:3 ]
Wed Apr 18 19:21:21 2018 us=98512 Local Options String (VER=V4): 'V4,dev-type tap,link-mtu 1590,tun-mtu 1532,proto UDPv4,comp-lzo,cipher AES-128-CBC,auth SHA1,keysize 128,key-method 2,tls-client'
Wed Apr 18 19:21:21 2018 us=98512 Expected Remote Options String (VER=V4): 'V4,dev-type tap,link-mtu 1590,tun-mtu 1532,proto UDPv4,comp-lzo,cipher AES-128-CBC,auth SHA1,keysize 128,key-method 2,tls-server'
Wed Apr 18 19:21:21 2018 us=99012 TCP/UDP: Preserving recently used remote address: [AF_INET]188.240.175.69:12974
Wed Apr 18 19:21:21 2018 us=99012 Socket Buffers: R=[65536->65536] S=[65536->65536]
Wed Apr 18 19:21:21 2018 us=99012 UDP link local: (not bound)
Wed Apr 18 19:21:21 2018 us=99012 UDP link remote: [AF_INET]188.240.175.69:12974
Wed Apr 18 19:21:21 2018 us=99012 MANAGEMENT: >STATE:1524075681,WAIT,,,,,,
Wed Apr 18 19:21:21 2018 us=123534 MANAGEMENT: >STATE:1524075681,AUTH,,,,,,
Wed Apr 18 19:21:21 2018 us=123534 TLS: Initial packet from [AF_INET]188.240.175.69:12974, sid=b8f749bc 94d2f334
Wed Apr 18 19:21:21 2018 us=274714 VERIFY OK: depth=1, C=TW, ST=TW, L=Taipei, O=netgear, OU=netgear, CN=netgear, emailAddress=mail@netgear.com
Wed Apr 18 19:21:21 2018 us=275209 Certificate does not have key usage extension
Wed Apr 18 19:21:21 2018 us=275209 VERIFY KU ERROR
Wed Apr 18 19:21:21 2018 us=275209 OpenSSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Wed Apr 18 19:21:21 2018 us=275209 TLS_ERROR: BIO read tls_read_plaintext error
Wed Apr 18 19:21:21 2018 us=275209 TLS Error: TLS object -> incoming plaintext read error
Wed Apr 18 19:21:21 2018 us=275209 TLS Error: TLS handshake failed
Wed Apr 18 19:21:21 2018 us=275671 TCP/UDP: Closing socket
Wed Apr 18 19:21:21 2018 us=275671 SIGUSR1[soft,tls-error] received, process restarting
Wed Apr 18 19:21:21 2018 us=275671 MANAGEMENT: >STATE:1524075681,RECONNECTING,tls-error,,,,,
Wed Apr 18 19:21:21 2018 us=275671 Restart pause, 5 second(s)
Wed Apr 18 19:21:26 2018 us=278750 Re-using SSL/TLS context
Wed Apr 18 19:21:26 2018 us=278750 LZO compression initializing
Wed Apr 18 19:21:26 2018 us=279194 Control Channel MTU parms [ L:1654 D:1212 EF:38 EB:0 ET:0 EL:3 ]
Wed Apr 18 19:21:26 2018 us=279194 Data Channel MTU parms [ L:1654 D:1450 EF:122 EB:411 ET:32 EL:3 ]
Wed Apr 18 19:21:26 2018 us=279194 Local Options String (VER=V4): 'V4,dev-type tap,link-mtu 1590,tun-mtu 1532,proto UDPv4,comp-lzo,cipher AES-128-CBC,auth SHA1,keysize 128,key-method 2,tls-client'
Wed Apr 18 19:21:26 2018 us=279194 Expected Remote Options String (VER=V4): 'V4,dev-type tap,link-mtu 1590,tun-mtu 1532,proto UDPv4,comp-lzo,cipher AES-128-CBC,auth SHA1,keysize 128,key-method 2,tls-server'
Wed Apr 18 19:21:26 2018 us=279194 TCP/UDP: Preserving recently used remote address: [AF_INET]188.240.175.69:12974
Wed Apr 18 19:21:26 2018 us=279194 Socket Buffers: R=[65536->65536] S=[65536->65536]
Wed Apr 18 19:21:26 2018 us=279194 UDP link local: (not bound)
Wed Apr 18 19:21:26 2018 us=279194 UDP link remote: [AF_INET]188.240.175.69:12974
Wed Apr 18 19:21:26 2018 us=279694 MANAGEMENT: >STATE:1524075686,WAIT,,,,,,
Wed Apr 18 19:21:26 2018 us=304217 MANAGEMENT: >STATE:1524075686,AUTH,,,,,,
Wed Apr 18 19:21:26 2018 us=304217 TLS: Initial packet from [AF_INET]188.240.175.69:12974, sid=cd35f207 20a8cc76
Wed Apr 18 19:21:26 2018 us=452850 VERIFY OK: depth=1, C=TW, ST=TW, L=Taipei, O=netgear, OU=netgear, CN=netgear, emailAddress=mail@netgear.com
Wed Apr 18 19:21:26 2018 us=453353 Certificate does not have key usage extension
Wed Apr 18 19:21:26 2018 us=453353 VERIFY KU ERROR
Wed Apr 18 19:21:26 2018 us=453353 OpenSSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Wed Apr 18 19:21:26 2018 us=453353 TLS_ERROR: BIO read tls_read_plaintext error
Wed Apr 18 19:21:26 2018 us=453353 TLS Error: TLS object -> incoming plaintext read error
Wed Apr 18 19:21:26 2018 us=453353 TLS Error: TLS handshake failed
Wed Apr 18 19:21:26 2018 us=453850 TCP/UDP: Closing socket
Wed Apr 18 19:21:26 2018 us=453850 SIGUSR1[soft,tls-error] received, process restarting
Wed Apr 18 19:21:26 2018 us=453850 MANAGEMENT: >STATE:1524075686,RECONNECTING,tls-error,,,,,
Wed Apr 18 19:21:26 2018 us=454351 Restart pause, 5 second(s)
Wed Apr 18 19:21:29 2018 us=455072 SIGTERM[hard,init_instance] received, process exiting
Wed Apr 18 19:21:29 2018 us=455519 MANAGEMENT: >STATE:1524075689,EXITING,init_instance,,,,,

Can anyone help?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: openssl new versions consider md certificates too weak

Post by TinCanTech » Wed Apr 18, 2018 7:16 pm

DoubleSpeed wrote:
Wed Apr 18, 2018 6:31 pm
Having difficulty connecting to my VPN and troubleshooting this I came across this post, I've added:

tls-cipher "DEFAULT:@SECLEVEL=0"
remote-cert-tls server

To my config it now kind of connects, however, keeps reconnecting/refreshing my logs says...

Wed Apr 18 19:21:21 2018 us=97512 No valid translation found for TLS cipher '@SECLEVEL=0'

You could have at least confirmed the version of openvpn you are using:

Code: Select all

openvpn --version
:roll:

  • :arrow: Please do not use SECLEVEL=0

    The reason is self explanatory, IE: Security Level Zero .. No Security. :!:

    The correct solution is to recreate your PKI with EasyRSA
:o


For further help Please see:
HOWTO: Request Help !

DoubleSpeed
OpenVpn Newbie
Posts: 2
Joined: Wed Apr 18, 2018 6:24 pm

Re: {Resolved} openssl new versions consider md certificates too weak

Post by DoubleSpeed » Thu Apr 19, 2018 5:26 am

OK thanks for your reply, I literally downloaded the latest version of the Windows client today with regard to the host version this is provided by my Netgear Nighthawk X6 Router and it is this that generated the cert/keys etc so not too sure about how I can recreate the PKI?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: {Resolved} openssl new versions consider md certificates too weak

Post by TinCanTech » Thu Apr 19, 2018 11:38 am

Read the easyrsa documentation, create your new PKI and upload the server files to your device.

Or ask Netgear for help.

MartinK
OpenVpn Newbie
Posts: 1
Joined: Wed May 16, 2018 2:53 pm

Re: openssl new versions consider md certificates too weak

Post by MartinK » Wed May 16, 2018 3:10 pm

Hi,

SHA1 and MD5 is outdated.

There are several ways to build up a new PKI. You can use EasyRSA, but there are some other tools. I prefer a gui driven tool xca
* http://xca.hohnstaedt.de/xca

With xca you can organize all your certifikates and keys. In the tree-view you see which certificate was signed by which ca. Very useful when you are in trouble because of certificate-key-mismatch or by using the wrong ca ...

There are (openvpn-)template-files available (for ca, server, client):
* https://community.openvpn.net/openvpn/wiki/XCA#no1

There are several tutorials on the web.

good luck

maverick74
OpenVpn Newbie
Posts: 2
Joined: Tue May 22, 2018 2:46 pm

Re: {Resolved} openssl new versions consider md certificates too weak

Post by maverick74 » Tue May 22, 2018 2:50 pm

I'm having this same issues!!! However, since ATM we cannot regenerate our keys, we need a temporary workaround!!!

I was wondering where can i use that "DEFAULT:@SECLEVEL=0" set to allow old keys. I'm on Linux with plasma-nm5. I've tried to set it in a few places but with no luck.

can anyone help?

Thanks

mavron
OpenVpn Newbie
Posts: 1
Joined: Tue May 29, 2018 9:49 am

Re: {Resolved} openssl new versions consider md certificates too weak

Post by mavron » Tue May 29, 2018 10:15 am

maverick74 wrote:
Tue May 22, 2018 2:50 pm
I was wondering where can i use that "DEFAULT:@SECLEVEL=0" set to allow old keys. I'm on Linux with plasma-nm5. I've tried to set it in a few places but with no luck.
Hi, I had your very same issues (original problem, and problem with the workaround) after upgrading from Kubuntu 16.04 to 18.04
I didn't find a place in the network-manager-openvpn gui to put the tls cipher option (anybody?), so I took a peek at the source code and came up with the following, while waiting for our IT dept to regenerate the certs:
  • Find your Network Manager vpn configuration file (mine is in /etc/NetworkManager/system-connections; if you have a lot of them and filenames do not help much in finding the right one, use grep -i "id=yourmnemonicname" *)
  • Under the [vpn] section add the line:
    tls-cipher=DEFAULT:@SECLEVEL=0
  • Reload the configuration with the command: nmcli connection reload

maverick74
OpenVpn Newbie
Posts: 2
Joined: Tue May 22, 2018 2:46 pm

Re: {Resolved} openssl new versions consider md certificates too weak

Post by maverick74 » Wed May 30, 2018 10:49 am

THANK YOU SO MUCH!!!

Worked like a charm!!! :D

In about a couple of weeks we're going to regenerate the certs, but until then we had to find some temporary workaround to keep functioning!!!

Again: thank you so much for sharing (specially when no one else would!).

Locked