I would like to build a DLL for calling OpenZiti features from my software. I'm not familiar with CMake, vcpkg nor Visual Studio so I'm currently lost among all these concepts and tools! Is there a how-to somewhere explaining the simplest way and commands to generate a DLL from the C SDK and all the requested dependencies? That would save me so much time...
As for building it yourself, I'm sorry to tell you this, but you're in for a journey... Far too much for me to put into a discourse post, I'm afraid. There's no single how-to when it comes to lots of C-related topics, including the build process. Instead, maybe you can tell us what you're trying to do?
As time permits, I update our c# sdk with the C SDK and there are a few things c# doesn't do well when it comes to interop, and it builds a .DLL for use from c#. It's on my list to update, but it's been lagging behind a fair bit. You can look at that project as it does basically what I think you're asking. Have a look at this project ziti-sdk-csharp/ZitiNativeApiForDotnetCore at main · openziti/ziti-sdk-csharp · GitHub. There's a bat file in that project that MIGHT be useful?
I didn't know there were libraries on github as the folder releases is not visible. This is good news. I just need my app to call the standard features noticed here: Ziti C SDK: Main Page. If this is what offers this DLL, this is perfect.
Before testing this, I must be able to enroll an identity from my app using the API but I don't succeed. I tried https://ziti.myserver.eu:8441/edge/client/v1/enroll/ott?token=c4ad59e7-67d0-4191-8040-28328a6879f5 but I receive this response:
{
"error": {
"code": "INVALID_CONTENT_TYPE",
"message": "The content type supplied is not acceptable: ",
"requestId": "dyu3bX1xP"
},
"meta": {
"apiEnrollmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
Actually, I would like to enroll my software like I add an identity to the tunneler. Can you tell me where I'm wrong? Thanks.
I don't know what you mean. The releases are all public and they are not checked into the repository. You can just download them.
What language are you using? What does your code look like? Have you found all the C sdk examples? ziti-sdk-c/programs/sample_enroll at main · openziti/ziti-sdk-c · GitHub shows you how to enroll. I'm not sure why you're trying to use UPDB, imo, I don't think you want to use updb with openziti. It probably makes a lot of sense for your app, but I would probably use cert-based auth for OpenZiti.
I assume you have your own server and your own API. That server would automate the OpenZiti overlay via OpenZiti's APIs. In general, the flow would look like this from your app:
the user "registers" for your app. signs up, whatever your process is
as part of the "register" process with your app, your server provisions an identity on the OpenZiti overlay and returns the jwt to the user's app as part of this process
the client side app "enrolls" that jwt, generating/using a key and cert on that device and creating an identity on that machine
your app uses the identity file to establish secure connectivity via the OpenZiti overlay
At that point you have a secure connection and your app can use OpenZiti