Skip to content

[feature] Add support for OpenVPN tls_auth option #174

Closed

Description

@nemesifier

Add support for OpenVPN tls_auth option (client or server, automatically detected depending on the mode used) in both the OpenVPN backend and in the OpenWRT backend.

Look for tls-auth in the openvpn manual.

We should update the auto_client method to take this into account, if a tls-auth key is defined for the server it will be needed also on the client.

It would be great to allow the syntax to be backward compatible with what is currently used now:
"tls_auth": "path/to/fie.key 0"
"tls_auth": "path/to/fie.key 1"

We should know whether it's zero or 1 because we know if it's a server or client conf so we can generate that on our own during the conversion, but if the value is already present it could be good to be forgiving and ensure it works anyway because the current config deployed around are like that.

Ideally, I think we should do the following:

  • trim the contents of tls_auth and check whether it contains a space
    • if it does, it means it's the old way, and we should leave it as it
    • if it doesn't, it means it's the new way, we should interpret the content as the TLS key and add it to the files, then generate the right 0 or 1 depending on whether it's a client or server conf

Metadata

Metadata

Assignees

Labels

enhancementimportant

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions