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

Importing VPN fails #6

Open
Daviey opened this issue Nov 27, 2020 · 0 comments · May be fixed by #7
Open

Importing VPN fails #6

Daviey opened this issue Nov 27, 2020 · 0 comments · May be fixed by #7

Comments

@Daviey
Copy link

Daviey commented Nov 27, 2020

❯ htb lab import
[!] failed to import vpn configuration
[!] tip: try importing the config manually and fixing any network manager issues:
	nmcli connection import type openvpn file {your-ovpn-file}
[!] nmcli stderr output:
Error: failed to import '/tmp/tmp4i7m9rfu': The file to be imported wasn’t a valid OpenVPN client configuration.

Inspecting the temp openvpn file, it appears as empty which is why the import is failing.

Daviey added a commit to Daviey/python-htb that referenced this issue Nov 27, 2020
Previously, the command `htb lab import` would fail.  This is because it
was writing an empty file, as the write() would be buffered and not
flush to file before the `nmcli` import was called.

This change explicitly calls flush() to commit the changes to the file,
meaning the contents is written to the file.

Fixes: calebstewart#6
Signed-off-by: Dave Walker (Daviey) <[email protected]>
@Daviey Daviey linked a pull request Nov 27, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant