How Java communicates with ziti

How Java actually communicates with open ziti?
In ziti-sdk-jvm/HttpSample.java at main · openziti/ziti-sdk-jvm · GitHub
there is only call to Ziti.init(args[0], “”.toCharArray(), true) and after that using plain HttpURLConnection

Took a quick look… I will aim to give you a brief heads up but are not a java developer.

I think the best way to start is to think about it this way.

Rather than calling a http listener service… you dial a zitified method.

When you dial a zitified method… you pass in two parameters

#1. json token for the identity after you have enrolled it
#2. service that you want to dial

Once you have this done… then everything should just work the same… its just that its going over a ziti network mesh… rather than… over a public dns…

Hope that makes sense.

@markamind makes some good comments. @sevarac - just how deeply do you want to get into this? :slight_smile: I saw your other/first post and just commented on it. It might show you enough for what you want to do.

Really what happens is either you simple creat a secure connection to the other side (which is the ‘magic’ that ziti does for you) and you just write the bytes you want to write (or read) or the JRE is instrumented by the ziti SDK and learns how to “intercept” addresses on your behalf.

Your question is a big vague though. If you could maybe narrow down the actual question, I could hopefully provide a better answer

When you initialize Ziti SDK in seamless mode (last parameter in the init call) it injects overlay socket implementation into Java internals. So when URLConnection initializes network connection it will actually get the overlay connection to a Ziti service.

1 Like

Thanks for all the answers.
@ekoby explained what I was wondering