I am aware that there are SSL libraries available for SGX. But How to establish a secret between the SGX and the clients without letting the host knows it? Trivial methods fail, like:
Have a public-private key pair built-in the SGX, then the client sends the session key to the SGX. The session key is encrypted by the public key of SGX.
This doesn't work because the host can get the private key directly from the compiled SGX enclave executable.
Running an https server in the SGX can neither do the trick, also because there is no authentication nor pre-shared secret between the SGX and clients.