Hello Team,
Still discovering Ziti secrets! After succeeding access to one http web site using the overlay, I tried to access other resources on the same server: in my case an https server. As it did not work, I tried with http protocol but again, it's not working. Here are the cli settings I entered. Can someone tell me where I make a mistake?
export http_server="192.168.1.10"
#1. Create an identity for the HTTP client and assign an attribute "http-clients". We'll use this attribute when authorizing the clients to access the HTTP service
ziti edge create identity pcv-el -a 'http-clients' -o pcv-el.jwt
#2. Create an identity for the HTTP server if you are not using an edge-router with the tunneling option enabled
ziti edge create identity myserver -o myserver.jwt
export http_server_id="HeSG1bSG4o" -> server ID
#3. Create an intercept.v1 config.
ziti edge create config http1.intercept.v1 intercept.v1 '{"protocols":["tcp"],"addresses":["site1.mydomain.eu"], "portRanges":[{"low":80, "high":80}]}'
ziti edge create config http2.intercept.v1 intercept.v1 '{"protocols":["tcp"],"addresses":["site2.mydomain.eu"], "portRanges":[{"low":80, "high":80}]}'
#4. Create a host.v1 config.
ziti edge create config http1.host.v1 host.v1 '{"protocol":"tcp", "address":"'"${http_server}"'", "port":80}'
ziti edge create config http2.host.v1 host.v1 '{"protocol":"tcp", "address":"'"${http_server}"'", "port":80}'
I tried using only one host config because server and port is the same for both sites but it failed too. That's why I create two host configs.
#5. Create a service to associate the two configs created previously into a service.
ziti edge create service http1.svc --configs http1.intercept.v1,http1.host.v1
ziti edge create service http2.svc --configs http2.intercept.v1,http2.host.v1
#6. Create a service-policy to authorize "HTTP Clients" to "dial" the service representing the HTTP server.
ziti edge create service-policy http1.policy.dial Dial --service-roles "@http1.svc" --identity-roles '#http-clients'
ziti edge create service-policy http2.policy.dial Dial --service-roles "@http2.svc" --identity-roles '#http-clients'
#7. Create a service-policy to authorize the "HTTP Server" to "bind" the service representing the HTTP server.
ziti edge create service-policy http1.policy.bind Bind --service-roles '@http1.svc' --identity-roles "@${http_server_id}"
ziti edge create service-policy http2.policy.bind Bind --service-roles '@http2.svc' --identity-roles "@${http_server_id}"
Thanks.