Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenVPN: cannot load CA certificate file #3729

Closed
claasgo opened this issue Sep 27, 2019 · 4 comments
Closed

OpenVPN: cannot load CA certificate file #3729

claasgo opened this issue Sep 27, 2019 · 4 comments
Labels
upstream Third party issue

Comments

@claasgo
Copy link

claasgo commented Sep 27, 2019

Describe the bug
After Upgrading my HA-Setup Slave from 18.7.4_1 to 19.7.4, my OpenVPN services can't start with the Message:
Cannot load CA certificate file /var/etc/openvpn/server9.ca (only 1 of 2 entries were valid X509 names)

I've got multiple VPN Instances and each one has the same failure.
Master is still on 18.7.4_1.

Expected behavior
a running ovpn service

Relevant log files
Sep 25 20:49:46 openvpn[32795]: Exiting due to fatal error Sep 25 20:49:46 openvpn[32795]: Cannot load CA certificate file /var/etc/openvpn/server9.ca (only 1 of 2 entries were valid X509 names) Sep 25 20:49:46 openvpn[32795]: Cannot load CA certificate file /var/etc/openvpn/server9.ca (entry 2 did not validate) Sep 25 20:49:46 openvpn[32795]: OpenSSL: error:0B07C065:x509 certificate routines:X509_STORE_add_cert:cert already in hash table Sep 25 20:49:46 openvpn[32795]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts Sep 25 20:49:46 openvpn[32795]: WARNING: using --duplicate-cn and --client-config-dir together is probably not what you want Sep 25 20:49:46 openvpn[31712]: library versions: OpenSSL 1.0.2s 28 May 2019, LZO 2.10 Sep 25 20:49:46 openvpn[31712]: OpenVPN 2.4.7 amd64-portbld-freebsd11.2 [SSL (OpenSSL)] [LZO] [LZ4] [MH/RECVDA] [AEAD] built on Sep 10 2019

Additional context
I took a closer look to the CA Files (/var/etc/openvpn/*) and I'm wondering that each CA file as two, 100% identical certs included in one file. I compared that with my Master Node which only has one cert in each CA file.

For example (content modified for privacy reasons):

`# cat /var/etc/openvpn/server9.ca

-----BEGIN C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+sesdPLI49xC/torb5z4gZo6a6OqP3shV8pkXEqS
7gy72IahaErbUEUMDiv0Esv7gxnTvTvXwJ/WZfa2tW+ToXsjEOvN8FXG+Y2zI/uF
63bUZrhFQ0lxdOIFAgMBAAGjUDBOMB0GA1UdDgQWBBQlcyVHJRJTeDe3MoUHGXZz
y6ldVDAfBgNVHSMEGDAWgBQlcyVHJRJTeDe3MoUHGXZzy6ldVDAMBgNVHRMEBTAD
AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCDnk1oxq+qK5F2+Wz19thPn6m2akWCdCin
IXTJI5Y2HrGLZddCR9jbIMj6Fli6UutO0Q0iadn4aEIA1lN77bxn5h66/canlNP7
tUrUpPim65FkvSHpVCkjYO47QxoaYJNESU9gLMtpPAsUxnJX1zPT4IaO6V76dmxG
4azjHNs+rmjMk19QOZdv1XrQ+FV5fkQcg+4KWxCO4z193npQhus8GV3VxutZvKnv
Qa6S2TlJFYuKnJdSCbqjguIYMoZEgX6Ja8/lzZ3ZwSfVgvLMZ+AWSAxYzBVUl1pq
bHAG0CeJ9jFmg2JL5XvtyW1JMWTeFR7UUfR/RCbxf7GMuFYjVe
-----END CERTIFICATE-----

For testing purposes I deleted the duplicate part in each CA File but as soon as I start the VPN Service, all files contains again a douple cert. Even if I completly delete a CA file and start the service: a new CA file will be created with a douple cert included.

Environment
OPNsense 19.7.4 (amd64, OpenSSL).

@fichtner
Copy link
Member

Since it's OpenSSL itself and not LibreSSL that could be problematic... Did you report this to OpenVPN yet? It's their binary that complains about it.

@fichtner fichtner added the upstream Third party issue label Sep 27, 2019
@fichtner fichtner changed the title Cannot load CA certificate file OpenVPN: cannot load CA certificate file Sep 27, 2019
@claasgo
Copy link
Author

claasgo commented Sep 27, 2019

No I did not report that to openvpn. Was hopeing to get help here ;-)

@claasgo
Copy link
Author

claasgo commented Sep 27, 2019

Okay - looks like an OpenVPN bug. I reverted my VM back to 18.7.x and upgraded to 19.1.4 and as soon as OpenVPN 2.4.7 is used - the cert's are corrupted.

Thank you - I close this issue now.

@claasgo claasgo closed this as completed Sep 27, 2019
@eburghar
Copy link

I don't think it's an openvpn bug as it only reads the configuration files provisioned by opnsense. If certs are duplicated in files, how can it be the fault of openvpn ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Third party issue
Development

No branches or pull requests

3 participants