SmartCard TLS_ERROR: BIO read tls_read_plaintext error
Posted: Mon Aug 31, 2020 4:12 pm
Hello,
I had a openvpn server installed on raspbian deb 9 and everything worked fine. I upgraded to raspbian deb 10 and made a clean, probably newer version, openvpn install.
I imported the CA-Chain, CRL and Key in the serverconfiguration, as it was in the previous install.
Clients, which do not have a certificate/key saved on the smartcard can connect fine.
However when I try to connect with my smartcard, the connection fails.
(The Serialized id from the new windows version did not work, but that was also the case before. I have to use an older version to get the correct id) gives
But as mentioned this is another topic.
This is the client output verbose level: 3
Even other verbose levels didn't helped me; same on the server-side.
Please tell me, which verbose levels, especially for the server, I can try out, so you can hopefully find the problem.
Versions:
Client-Config: (Certs and TLS-Key are edited, so invalid right as the are here)
Server-Config:
I appreciate any help 
I had a openvpn server installed on raspbian deb 9 and everything worked fine. I upgraded to raspbian deb 10 and made a clean, probably newer version, openvpn install.
I imported the CA-Chain, CRL and Key in the serverconfiguration, as it was in the previous install.
Clients, which do not have a certificate/key saved on the smartcard can connect fine.
However when I try to connect with my smartcard, the connection fails.
(The Serialized id from the new windows version did not work, but that was also the case before. I have to use an older version to get the correct id)
Code: Select all
.\openvpn.exe --show-pkcs11-ids "C:\Windows\System32\cvP11.dll"
Code: Select all
pkcs11:model=JavaCardOS;token=Jan%20Kleefeld;manufacturer=cv%20cryptovision%20gmbh%20%28c%29%20v1.0j;serial=3036393837343232;id=C%14%a7_d%ba%fc%28
This is the client output verbose level: 3
Code: Select all
Mon Aug 31 17:37:06 2020 OpenVPN 2.4.9 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Apr 16 2020
Mon Aug 31 17:37:06 2020 Windows version 6.2 (Windows 8 or greater) 64bit
Mon Aug 31 17:37:06 2020 library versions: OpenSSL 1.1.1f 31 Mar 2020, LZO 2.10
Enter Management Password:
Mon Aug 31 17:37:06 2020 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25341
Mon Aug 31 17:37:06 2020 Need hold release from management interface, waiting...
Mon Aug 31 17:37:06 2020 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25341
Mon Aug 31 17:37:06 2020 MANAGEMENT: CMD 'state on'
Mon Aug 31 17:37:06 2020 MANAGEMENT: CMD 'log all on'
Mon Aug 31 17:37:06 2020 MANAGEMENT: CMD 'echo all on'
Mon Aug 31 17:37:06 2020 MANAGEMENT: CMD 'bytecount 5'
Mon Aug 31 17:37:06 2020 MANAGEMENT: CMD 'hold off'
Mon Aug 31 17:37:06 2020 MANAGEMENT: CMD 'hold release'
Mon Aug 31 17:37:06 2020 PKCS#11: Adding PKCS#11 provider 'C:\Windows\System32\cvP11.dll'
Mon Aug 31 17:37:07 2020 Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Mon Aug 31 17:37:07 2020 Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Mon Aug 31 17:37:07 2020 Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Mon Aug 31 17:37:07 2020 Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Mon Aug 31 17:37:07 2020 MANAGEMENT: >STATE:1598888227,RESOLVE,,,,,,
Mon Aug 31 17:37:07 2020 TCP/UDP: Preserving recently used remote address: [AF_INET]192.168.2.150:1194
Mon Aug 31 17:37:07 2020 Socket Buffers: R=[65536->65536] S=[64512->64512]
Mon Aug 31 17:37:07 2020 UDP link local: (not bound)
Mon Aug 31 17:37:07 2020 UDP link remote: [AF_INET]192.168.2.150:1194
Mon Aug 31 17:37:07 2020 MANAGEMENT: >STATE:1598888227,WAIT,,,,,,
Mon Aug 31 17:37:07 2020 MANAGEMENT: >STATE:1598888227,AUTH,,,,,,
Mon Aug 31 17:37:07 2020 TLS: Initial packet from [AF_INET]192.168.2.150:1194, sid=49310fc1 41d899c8
Mon Aug 31 17:37:07 2020 VERIFY OK: depth=2, C=DE, ST=NRW, L=Velbert, O=jan-home.de, OU=Certificate Authority, CN=ROOT CA jan-home.de, emailAddress=support@jan-home.de
Mon Aug 31 17:37:07 2020 VERIFY OK: depth=1, C=DE, ST=NRW, L=Velbert, O=jan-home.de, OU=Certificate Authority, CN=Intermediate CA VPN jan-home.de, emailAddress=support@jan-home.de
Mon Aug 31 17:37:07 2020 VERIFY KU OK
Mon Aug 31 17:37:07 2020 Validating certificate extended key usage
Mon Aug 31 17:37:07 2020 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Mon Aug 31 17:37:07 2020 VERIFY EKU OK
Mon Aug 31 17:37:07 2020 VERIFY X509NAME OK: C=DE, ST=NRW, L=Velbert, O=jan-home.de, OU=OpenVPN_Server, CN=OpenVPN_Server_2, emailAddress=support@jan-home.de
Mon Aug 31 17:37:07 2020 VERIFY OK: depth=0, C=DE, ST=NRW, L=Velbert, O=jan-home.de, OU=OpenVPN_Server, CN=OpenVPN_Server_2, emailAddress=support@jan-home.de
Mon Aug 31 17:37:07 2020 OpenSSL: error:141F0006:SSL routines:tls_construct_cert_verify:EVP lib
Mon Aug 31 17:37:07 2020 TLS_ERROR: BIO read tls_read_plaintext error
Mon Aug 31 17:37:07 2020 TLS Error: TLS object -> incoming plaintext read error
Mon Aug 31 17:37:07 2020 TLS Error: TLS handshake failed
Mon Aug 31 17:37:07 2020 SIGUSR1[soft,tls-error] received, process restarting
Mon Aug 31 17:37:07 2020 MANAGEMENT: >STATE:1598888227,RECONNECTING,tls-error,,,,,
Mon Aug 31 17:37:07 2020 Restart pause, 5 second(s)
Mon Aug 31 17:37:09 2020 SIGTERM[hard,init_instance] received, process exiting
Mon Aug 31 17:37:09 2020 MANAGEMENT: >STATE:1598888229,EXITING,init_instance,,,,,
Please tell me, which verbose levels, especially for the server, I can try out, so you can hopefully find the problem.
Versions:
Code: Select all
openvpn --version
OpenVPN 2.4.7 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Feb 20 2019
library versions: OpenSSL 1.1.1d 10 Sep 2019, LZO 2.10
Code: Select all
apt-cache show openvpn
Package: openvpn
Version: 2.4.7-1
Architecture: armhf
Code: Select all
client
proto udp
explicit-exit-notify
remote jan-home.de 1194
dev tun
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
verify-x509-name OpenVPN_Server_2 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
pkcs11-providers 'C:\Windows\System32\cvP11.dll'
pkcs11-id 'cv\x20cryptovision\x20gmbh\x20\x28c\x29\x20v1\x2E0j/JavaCardOS/3036393837343232/Jan\x20Kleefeld/4314A75F64BAFC28'
key-direction 1
<ca>
-----BEGIN CERTIFICATE-----
MIIGezCCBGOgAwIBAgIISOK6cZeZx3swDQYJKoZIhvcNAQENBQAwgaUxCzAJBgNV
BAYTAkRFMQwwCgYDVQQIEwNOUlcxEDAOBgNVBAcTB1ZlbGJlcnQxFDASBgNVBAoT
C2phbi1ob21lLmRlMR4wHAYDVQQLExVDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHDAa
BgNVBAMTE1JPT1QgQ0EgamFuLWhvbWUuZGUxIjAgBgkqhkiG9w0BCQEWE3N1cHBv
cnRAamFuLWhvbWUuZGUwHhcNMjAwNzIyMDAwMDAwWhcNMzIwNzIxMjM1OTU5WjCB
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIGnzCCBIegAwIBAgIIUriT56sVMpIwDQYJKoZIhvcNAQENBQAwgaUxCzAJBgNV
BAYTAkRFMQwwCgYDVQQIEwNOUlcxEDAOBgNVBAcTB1ZlbGJlcnQxFDASBgNVBAoT
C2phbi1ob21lLmRlMR4wHAYDVQQLExVDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHDAa
BgNVBAMTE1JPT1QgQ0EgamFuLWhvbWUuZGUxIjAgBgkqhkiG9w0BCQEWE3N1cHBv
cnRAamFuLWhvbWUuZGUwHhcNMjAwNzIyMDAwMDAwWhcNMzAwNzIxMjM1OTU5WjCB
-----END CERTIFICATE-----
</ca>
<tls-crypt>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
193a629f3939fd340bc7d2375bcd346f
9dcbe859a96bd79a135d5f5bcf92eff0
3a541fd98252691f1f83b011e345b428
f2a8124ef010b65e068b186b16a24a3a
-----END OpenVPN Static key V1-----
</tls-crypt>
Code: Select all
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 "dhcp-option DNS 192.168.2.150"
push "redirect-gateway def1 bypass-dhcp"
dh none
ecdh-curve prime256v1
tls-crypt tls-crypt.key 0
crl-verify inter-crl.pem
ca ca-chain.crt
cert OpenVPN_Server_2.crt
key OpenVPN_Server_2.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
verb 11
