Hi:
While we were trying the sample Python echo server program from “ziti-sdk-py/sample/ziti-echo-server at main · openziti/ziti-sdk-py · GitHub”, there are some errors.
We re-used the .jwt and .json file from C# sample:
:~/Desktop/ziti_py$ python -m openziti enroll --jwt=weather.demo.jwt --identity=weather.demo.json
(6895)[ 0.018] ERROR ziti-sdk:ziti_enroll.c:64 verify_controller_jwt() failed to verify JWT signature
(6895)[ 0.018] ERROR ziti-sdk:ziti_ctrl.c:154 ctrl_resp_cb() ctrl[nick] request failed: -103(software caused connection abort)
(6895)[ 0.018] ERROR ziti-sdk:ziti_enroll.c:222 well_known_certs_cb() /home/runner/work/ziti-sdk-c/ziti-sdk-c/library/ziti_enroll.c:141 - ZITI_JWT_VERIFICATION_FAILED => -7 (JWT verification failed)
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.10/dist-packages/openziti/__main__.py", line 62, in <module>
args.func()
File "/usr/local/lib/python3.10/dist-packages/openziti/__main__.py", line 23, in do_enroll
id_json = zitilib.enroll(jwt, key=args.key, cert=args.cert)
File "/usr/local/lib/python3.10/dist-packages/openziti/zitilib.py", line 309, in enroll
raise RuntimeError(errorstr(retcode))
RuntimeError: JWT verification failed
:~/Desktop/ziti_py$ python Server.py weather.demo.json weather-svc
weather.demo.json
weather-svc
(6868)[ 0.000] ERROR ziti-sdk:ziti.c:216 ziti_init_opts() /home/runner/work/ziti-sdk-c/ziti-sdk-c/library/ziti.c:182 - load_config(options->config, &cfg) => -13 (Configuration is invalid)
Traceback (most recent call last):
File "/home/nick/Desktop/ziti_py/Server.py", line 27, in <module>
run(sys.argv[1], sys.argv[2])
File "/home/nick/Desktop/ziti_py/Server.py", line 6, in run
ztx = openziti.load(ziti_id)
File "/usr/local/lib/python3.10/dist-packages/openziti/context.py", line 87, in load_identity
return ZitiContext.from_path(path)
File "/usr/local/lib/python3.10/dist-packages/openziti/context.py", line 77, in from_path
return cls(zitilib.load(path))
File "/usr/local/lib/python3.10/dist-packages/openziti/context.py", line 27, in __init__
raise TypeError("ctx is not a valid python void pointer type")
TypeError: ctx is not a valid python void pointer type
What is the correct approach to create .jwt and .json under Python ?
And, how to run the Python echo server ?