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

File "apc-convert.py", line 364, in <module> #1

Open
olie93 opened this issue Mar 13, 2018 · 17 comments
Open

File "apc-convert.py", line 364, in <module> #1

olie93 opened this issue Mar 13, 2018 · 17 comments

Comments

@olie93
Copy link

olie93 commented Mar 13, 2018

When i run the script i get the below error:

Traceback (most recent call last):
File "apc-convert.py", line 364, in
apc.ca = ovpn.ca
File "apc-convert.py", line 237, in ca
if not value.startswith(CERT_START): raise ValueError()
ValueError

@tomkor
Copy link

tomkor commented Sep 7, 2018

The same problem

@DerVO
Copy link

DerVO commented Sep 10, 2018

Same here

@andreashergert1984
Copy link

andreashergert1984 commented Nov 7, 2018

me too;

perhaps becaue my openvpn has no client cert/key?..

@StrannikVK
Copy link

I have same problem, is there a fix?
I check the parameters and my OpenVPN file looks good.
Is there a solution?

@DaveFH
Copy link

DaveFH commented Jan 22, 2020

Same Problem...
tried with python2 und python3

Traceback (most recent call last):
  File "apc-convert.py", line 364, in <module>
    apc.ca = ovpn.ca
  File "apc-convert.py", line 237, in ca
    if not value.startswith(CERT_START): raise ValueError()
ValueError

@ca-za
Copy link
Owner

ca-za commented Dec 9, 2020

Sorry for the late response. The cause of this error is probably the wrong format of the ca certificate. There are plenty of different ways to store certificates and this script is designed to only handle the specific format SOPHOS used around that time. If you provide me your source files then I can maybe build in an workaround.

@lperezcwcocom
Copy link

was a solution to this ever posted or found?

@ca-za
Copy link
Owner

ca-za commented May 6, 2021

Unfortunately I can not recreate the problem, otherwise I could maybe solve this.

@lperezcwcocom
Copy link

this is my command line;
C:\apc-convert-master>apc-convert.py --username aqu020821 --password C0braK@i1931 ovpn2apc aqu.ovpn aqu.apc

the result 👍
Traceback (most recent call last):
File "C:\apc-convert-master\apc-convert.py", line 364, in
apc.ca = ovpn.ca
File "C:\apc-convert-master\apc-convert.py", line 237, in ca
if not value.startswith(CERT_START): raise ValueError()
ValueError

the OVPN file contains three certs. The CA, the CERT and the KEY.

@ca-za
Copy link
Owner

ca-za commented May 11, 2021

thank you, looks like SOPHOS changed the certificate format. I need some time to reproduce this in my lab.

@bithost
Copy link

bithost commented Aug 30, 2021

Any update on this?

@ca-za
Copy link
Owner

ca-za commented Sep 2, 2021

Any update on this?

unfortunately I could not reproduce this. Can you generate sample files for me?

@bithost
Copy link

bithost commented Sep 4, 2021

Hey. Sure, what files you want?

@ca-za
Copy link
Owner

ca-za commented Sep 5, 2021

just an apc export of an vpn profile. You can simply create a new connection and delete it after the export.

@fsmeets
Copy link

fsmeets commented Sep 17, 2021

I just came across this issue when trying to connect a stock OpenVPN to an XG 18.5.1 in S2S mode. Here is a config you can use to adapt the script. Thanks!
server_test.txt

I got this working manually, all I had to do after the conversion using the script was to put the -----BEGIN and -----END lines on their own line. The key, cert and ca can be one long line.

@Phosphenius
Copy link

I managed to fix the script so that it'll output a correctly formatted APC file. Unfortunately, I have no chance to really test it. But feel free to give it a try: https://github.com/Phosphenius/apc-convert

@speedy01
Copy link

@ca-za Thank you for your work. Unfortunately, I'm having the same error when trying to convert a OVPN to APC as well. I tried with python2 and python3 on linux. The ovpn file I'm trying to convert is provided by surfshark ( vpn provider).
@Phosphenius I've tried your modified version, but got a different error. something like RSA Key format not supported.

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

No branches or pull requests