HMAC Authentication Failed problems.

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
driver27
OpenVpn Newbie
Posts: 13
Joined: Mon Nov 10, 2014 9:26 am

HMAC Authentication Failed problems.

Post by driver27 » Sat Oct 24, 2020 11:32 am

Hi there,
My OpenVPN server has been and is running perfectly for some years now (so I have forgotten a lot I learned setting it up!).

Essentially whilst all configured clients connect just fine, bringing new IOS clients online is problematical in that I can't import the configuration via iTunes as of old so now have to produce a new comprehensive .opvn file for each.

I can take a configuration (consisting of ca.crt, ta.key, client.key. client.crt and client.ovpn) and it works fine using Tunnelblick on my iMac, then build a new client.ovpn with the certificates embedded, but when I import it to my iPad it will fail. My iPhone connects with a profile created two years ago, but if I build a new profile as above using the same files after import that to fails with the Authentication error in the server log and a connection timeout on the client.

I have been stumped by this for a while now and read many posts (including the sticky at the top) but can'f find the reason this is failing. Any pointers would be gratefully received.

Server.conf - redacted
Server config

#local <ip address>
port <port>
proto udp
dev tun0

ca /etc/openvpn/certs/ca.crt
cert /etc/openvpn/certs/hollyhop.crt
key /etc/openvpn/certs/hollyhop.key # This file should be kept secret
dh /etc/openvpn/certs/dh2048.pem
tls-auth /etc/openvpn/certs/ta.key 0

server 10.131.134.0 255.255.255.0
ifconfig-pool-persist ipp.txt

push "route 10.131.132.0 255.255.254.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
client-to-client

keepalive 10 120
cipher AES-256-CBC
max-clients 25

persist-key
persist-tun

status /var/log/openvpn-status.log
log-append /var/log/openvpn.log
verb 3
mute 20

explicit-exit-notify 1


Old client profile .ovpn
Old client config

client
dev tun
proto udp
remote <ip address> <port>
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert ipad.crt
key ipad.key
cipher AES-256-CBC
remote-cert-tls server
tls-auth ta.key 1
auth-nocache
verb 5
mute 20


New client profile .ovpn
New client profile

client
dev tun
proto udp
remote <ip address> <port>
resolv-retry infinite
nobind
persist-key
persist-tun
cipher AES-256-CBC
remote-cert-tls server
auth-nocache
verb 5
mute 20
<ca>
-----BEGIN CERTIFICATE-----
snip
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
snip
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
snip
-----END PRIVATE KEY-----
</key>
<tls-auth>
-----BEGIN OpenVPN Static key V1-----
snip
-----END OpenVPN Static key V1-----
</tls-auth>


openvpn server log extract

Code: Select all

Sat Oct 24 12:18:09 2020 Authenticate/Decrypt packet error: packet HMAC authentication failed
Sat Oct 24 12:18:09 2020 TLS Error: incoming packet authentication failed from [AF_INET]<ip address>:<port>
Last edited by Pippin on Sat Oct 24, 2020 4:08 pm, edited 1 time in total.
Reason: Formatting

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

Re: HMAC Authentication Failed problems.

Post by TinCanTech » Sat Oct 24, 2020 1:59 pm

You need --key-direction in your embedded client profile. See --key-direction in the manual.

driver27
OpenVpn Newbie
Posts: 13
Joined: Mon Nov 10, 2014 9:26 am

Re: HMAC Authentication Failed problems.

Post by driver27 » Sat Oct 24, 2020 5:27 pm

Thanks for your help, as ever the answer is in the doco :-)

Never having had to use the unified format before I overlooked it.
The directive is there implicitly in the old config files, but needs to be added thus in the unified file:

Code: Select all

-----END PRIVATE KEY-----
</key>
key-direction 1
<tls-auth>
-----BEGIN OpenVPN Static key V1-----

Post Reply