Quick update.. I think I have worked this out.. but still yet to test it
I thought to put my hypothesis out there in case others see something wrong.. as I am really the blind leading the blind
what helped is to search through the SDK folders.. I only just realised that you can do this..
As I could not find any TLS implementation.. I realised that it needs to be setup separately to the zitified listener..
well.. at least I think so.. from what I can work out
next breakthrough moment
Going through the steps to implement a Golang TLS server helped me understand what all of the config requirements are re certificates.. and the extra code required to implement.
The main line is the following which connects the http service to TLS.. where you need to pass in the certificate and private key
http.HandleFunc("/", handler)
err := http.ListenAndServeTLS(":443", "cert.pem", "key.pem", nil)
But.. now what..
Well.. here is a sample from the zitified http server.. where the http.Serve activates the ziti listener.
http.HandleFunc("/hello", hello)
http.HandleFunc("/add", add)
if err := http.Serve(createZitiListener(), nil); err != nil {
panic(err)
}
So.. if you combine these together.. this is what I believe is needed from a coding perspective.
http.HandleFunc("/hello", hello)
http.HandleFunc("/add", add)
if err := http.ListenAndServeTLS(":443", "cert.pem", "key.pem", nil); err != nil {
panic(err)
}
if err := http.Serve(createZitiListener(), nil); err != nil {
panic(err)
}
Now for the unknown piece
How do you create the certificate and private keys?
In the above example where I implemented a SSL golang server.. they used the following command
go run $(go env GOROOT)/src/crypto/tls/generate_cert.go --host=localhost
This creates two files in the directory that it is run in
However.. this is not linked to the keys from the controller or router.. so if I use this.. I think its going to fail.. with an error like bad certificate.
I do know that there is a ziti command for pkis.. but are not 100% sure on the variables
ziti pki create
This is now at the edge of my knowns.. and now everything else is 100% unknown.
Let me know if you have any tips are how to finish this off 