Skip to content

Latest commit

 

History

History

tls.reflect

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

tls.reflect

Listens on tls port 23456 and will echo back whatever is sent to the server, broadcasting to all clients.

Requirements

  • bash, jq, nc
  • Kubernetes (e.g. Docker Desktop with Kubernetes enabled)
  • kubectl
  • helm 3.0+
  • openssl

Setup

The setup.sh script:

  • installs Zilla to the Kubernetes cluster with helm and waits for the pod to start up
  • starts port forwarding
./setup.sh

output:

+ ZILLA_CHART=oci://ghcr.io/aklivity/charts/zilla
+ helm upgrade --install zilla-tls-reflect oci://ghcr.io/aklivity/charts/zilla --namespace zilla-tls-reflect --create-namespace --wait [...]
NAME: zilla-tls-reflect
LAST DEPLOYED: [...]
NAMESPACE: zilla-tls-reflect
STATUS: deployed
REVISION: 1
NOTES:
Zilla has been installed.
[...]
+ nc -z localhost 23456
+ kubectl port-forward --namespace zilla-tls-reflect service/zilla 23456
+ sleep 1
+ nc -z localhost 23456
Connection to localhost port 23456 [tcp/*] succeeded!

Verify behavior

Connect each client first, then send Hello, one from first client, then send Hello, two from second client.

openssl s_client -connect localhost:23456 -CAfile test-ca.crt -quiet -alpn echo

output:

depth=1 C = US, ST = California, L = Palo Alto, O = Aklivity, OU = Development, CN = Test CA
verify return:1
depth=0 C = US, ST = California, L = Palo Alto, O = Aklivity, OU = Development, CN = localhost
verify return:1

Type a Hello, one message and press enter.

output:

Hello, one
Hello, one
Hello, two
openssl s_client -connect localhost:23456 -CAfile test-ca.crt -quiet -alpn echo

output:

depth=1 C = US, ST = California, L = Palo Alto, O = Aklivity, OU = Development, CN = Test CA
verify return:1
depth=0 C = US, ST = California, L = Palo Alto, O = Aklivity, OU = Development, CN = localhost
verify return:1

Type a Hello, two message and press enter.

output:

Hello, one
Hello, two
Hello, two

Teardown

The teardown.sh script stops port forwarding, uninstalls Zilla and deletes the namespace.

./teardown.sh

output:

+ pgrep kubectl
99999
+ killall kubectl
+ helm uninstall zilla-reflect --namespace zilla-reflect
release "zilla-reflect" uninstalled
+ kubectl delete namespace zilla-reflect
namespace "zilla-reflect" deleted