title: openvpn - Authenticate/Decrypt packet error: packet HMAC authentication failed
body: <p>I have this <code>client ovpn</code> file like this</p>
  <pre><code>client
  proto udp
  explicit-exit-notify
  remote PUBLIC_IP 1194
  dev tun
  resolv-retry infinite
  nobind
  persist-key
  persist-tun
  remote-cert-tls server
  verify-x509-name server_2CAzflUWmRFturMk name
  auth SHA256
  auth-nocache
  cipher AES-128-GCM
  tls-client
  tls-version-min 1.2
  tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
  ignore-unknown-option block-outside-dns
  setenv opt block-outside-dns # Prevent Windows 10 DNS leak
  verb 3
  &lt;ca&gt;
  -----BEGIN CERTIFICATE-----
  CERT
  -----END CERTIFICATE-----
  &lt;/ca&gt;
  &lt;cert&gt;
  -----BEGIN CERTIFICATE-----
  CERT
  -----END CERTIFICATE-----
  &lt;/cert&gt;
  &lt;key&gt;
  -----BEGIN ENCRYPTED PRIVATE KEY-----
  KEY
  -----END ENCRYPTED PRIVATE KEY-----
  &lt;/key&gt;
  &lt;tls-crypt&gt;
  #
  # 2048 bit OpenVPN static key
  #
  -----BEGIN OpenVPN Static key V1-----
  KEY
  -----END OpenVPN Static key V1-----
  &lt;/tls-crypt&gt;
  </code></pre>
  <p>and this <code>server.conf</code></p>
  <pre><code>port 1194
  proto udp
  dev tun
  user nobody
  group nogroup
  persist-key
  persist-tun
  keepalive 10 120
  topology subnet
  server 10.8.0.0 255.255.255.0
  ifconfig-pool-persist ipp.txt
  push &quot;dhcp-option DNS 1.0.0.1&quot;
  push &quot;dhcp-option DNS 1.1.1.1&quot;
  push &quot;redirect-gateway def1 bypass-dhcp&quot;
  dh none
  ecdh-curve prime256v1
  tls-crypt tls-crypt.key 0
  crl-verify crl.pem
  ca ca.crt
  cert server_2CAzflUWmRFturMk.crt
  key server_2CAzflUWmRFturMk.key
  auth SHA256
  cipher AES-128-GCM
  ncp-ciphers AES-128-GCM
  tls-server
  tls-version-min 1.2
  tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
  client-config-dir /etc/openvpn/ccd
  status /var/log/openvpn/status.log
  log /var/log/openvpn.log
  verb 3
  </code></pre>
  <p>ufw firewall is disabled and have generated the openvpn client file through <a href="https://github.com/angristan/openvpn-install" rel="nofollow noreferrer">this</a> script (but have tried many different).</p>
  <p>The client is hanging on &quot;waiting for server response&quot; and the server logs this:</p>
  <p>openvpn.log</p>
  <pre><code>Thu Jun 25 11:50:29 2020 OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on May 14 2019
  Thu Jun 25 11:50:29 2020 library versions: OpenSSL 1.1.1  11 Sep 2018, LZO 2.08
  Thu Jun 25 11:50:29 2020 ECDH curve prime256v1 added
  Thu Jun 25 11:50:29 2020 Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
  Thu Jun 25 11:50:29 2020 Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
  Thu Jun 25 11:50:29 2020 Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
  Thu Jun 25 11:50:29 2020 Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
  Thu Jun 25 11:50:29 2020 TUN/TAP device tun0 opened
  Thu Jun 25 11:50:29 2020 TUN/TAP TX queue length set to 100
  Thu Jun 25 11:50:29 2020 do_ifconfig, tt-&gt;did_ifconfig_ipv6_setup=0
  Thu Jun 25 11:50:29 2020 /sbin/ip link set dev tun0 up mtu 1500
  Thu Jun 25 11:50:29 2020 /sbin/ip addr add dev tun0 10.8.0.1/24 broadcast 10.8.0.255
  Thu Jun 25 11:50:29 2020 Could not determine IPv4/IPv6 protocol. Using AF_INET
  Thu Jun 25 11:50:29 2020 Socket Buffers: R=[212992-&gt;212992] S=[212992-&gt;212992]
  Thu Jun 25 11:50:29 2020 UDPv4 link local (bound): [AF_INET][undef]:1194
  Thu Jun 25 11:50:29 2020 UDPv4 link remote: [AF_UNSPEC]
  Thu Jun 25 11:50:29 2020 GID set to nogroup
  Thu Jun 25 11:50:29 2020 UID set to nobody
  Thu Jun 25 11:50:29 2020 MULTI: multi_init called, r=256 v=256
  Thu Jun 25 11:50:29 2020 IFCONFIG POOL: base=10.8.0.2 size=252, ipv6=0
  Thu Jun 25 11:50:29 2020 IFCONFIG POOL LIST
  Thu Jun 25 11:50:29 2020 Initialization Sequence Completed
  </code></pre>
  <p>and the other log (openvpnas.log)</p>
  <pre><code>2020-06-25 11:55:39+0000 [-] OVPN 2 OUT: 'Thu Jun 25 11:55:39 2020 Authenticate/Decrypt packet error: packet HMAC authentication failed'
  2020-06-25 11:55:39+0000 [-] OVPN 2 OUT: 'Thu Jun 25 11:55:39 2020 TLS Error: incoming packet authentication failed from [AF_INET]IP:55955'
  </code></pre>
  <p>and that's the client log</p>
  <pre><code>2020-06-25 13:56:33.282083 SIGUSR1[soft,tls-error] received, process restarting
  2020-06-25 13:56:33.282124 MANAGEMENT: &gt;STATE:1593086193,RECONNECTING,tls-error,,,,,
  2020-06-25 13:56:35.328014 MANAGEMENT: CMD 'hold release'
  2020-06-25 13:56:35.328137 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
  2020-06-25 13:56:35.328327 TCP/UDP: Preserving recently used remote address: [AF_INET]1194
  2020-06-25 13:56:35.328479 Socket Buffers: R=[786896-&gt;786896] S=[9216-&gt;9216]
  2020-06-25 13:56:35.328505 UDP link local: (not bound)
  2020-06-25 13:56:35.328531 UDP link remote: [AF_INET]SERVERIP:1194
  2020-06-25 13:56:35.328575 MANAGEMENT: &gt;STATE:1593086195,WAIT,,,,,,
  2020-06-25 13:56:35.328919 MANAGEMENT: CMD 'hold release'
  </code></pre>
  <p>My vpn server used to works but I don't know what I did to break it.</p>
  <p>I tried also to reinstall openvpn, but don't know how to fix it and let clients connect</p>