-
Notifications
You must be signed in to change notification settings - Fork 44
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
tls: failed to parse private key #18
Comments
Not certain why I never got a notification for this but here we are. It looks like you have some extra data sitting at the top of your certs/key. I'm not an encryption expert, so I don't know if that actually matters. Your private key also appears to have different header/footer text. This may be a byproduct of how they were generated. Anyway, here is how your cert/keys should look:
|
Yeah, my first thoughts was just about that header before actual key. I removed it, but nothing changed. Decrypted key looks like:
Still, when I run hostscan-bypass with this decrypted key, and try to connect my AnyConnect client, it starts complain about "untrustworthy gateway" and close connection immidiately. |
Which OS are you trying to MITM?
In your anyconnect client you must uncheck the "block connections to
untrustworthy gateways" box. If you check my blog post you'll see a picture
of the setting.
…On Tue, Jan 26, 2021, 4:07 AM Artem Vetrov ***@***.***> wrote:
Yeah, my first thoughts was just about that header before actual key. I
removed it, but nothing changed.
The second thing I tried is convert encrypted RSA key to normal RSA:
openssl rsa -in cert.key -out cert.decrypted.key
Decrypted key looks like:
-----BEGIN RSA PRIVATE KEY-----
<redacted>
-----END RSA PRIVATE KEY-----
Still, when I run hostscan-bypass with this decrypted key, and try to
connect my AnyConnect client, it starts complain about "untrustworthy
gateway" and close connection immidiately.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or unsubscribe
.
|
AnyConnect runs inside Ubuntu 20.04 VM, and hostscan-bypass runs on host system (Gentoo Linux). Here some screenshots inside Ubuntu VM: https://imgur.com/a/qFgS6qr |
It sounds like the Linux AnyConnect is not respecting your choice. There was a similar issue described in the OS X troubleshooting thread (#4). Specifically, this comment. I won't be able to troubleshoot your specific AnyConnect issue but what I can say is that you are on the right track. Your new private key is working correctly. If you can get Linux/AnyConnect to let you connect to untrusted servers you'll be in the clear. If you run into trouble finding the root cause then the final thing you can do is put the hostscan-bypass on a legitimate domain with a real SSL cert (letsencrypt). Since the SSL cert is real AnyConnect will trust the connection. |
Trying to connect my AnyConnect linux client to running hostscan-bypass cause
tls: failed to parse private key
in hostscan stdout and then timeout error on AnyConnect client (obviously).My hostscan run command is:
sudo go run hostscan-bypass.go -l <my-ip> -p 443 -r <redacted>:443 -s -client-cert cert.pem -client-key cert.key
cert.pem in the following format:
cert.key:
Full hostscan-bypass stdout is just
Much appreciate if you can help me with this.
And thanks for your hard work!
The text was updated successfully, but these errors were encountered: