ADD Enclave TLS Server demo

This commit is contained in:
Shirong Hao 2021-04-15 02:14:09 +00:00 committed by Zongmin.Gu
parent 4395ec7f81
commit 0c0c4c4abc
3 changed files with 49 additions and 0 deletions

@ -0,0 +1,20 @@
# Use Enclave TLS server with Occlum
This project demonstrates how to run a server with [Enclave TLS](https://github.com/alibaba/inclavare-containers/tree/master/enclave-tls).
Step 1: Download and build Enclave TLS.
```shell
./download_and_build_enclave_tls.sh
```
When completed, the resulting server can be found at `/opt/enclave-tls/bin`.
Step 2: You can run the encalve tls server on Occlum.
```shell
./run_enclave_tls_server_in_occlum.sh
```
Step 3: To check whether the enclave tls server works, run
```shell
/opt/enclave-tls/bin/enclave-tls-client
```
in another terminal.

@ -0,0 +1,9 @@
#!/bin/bash
set -e
# Download and Build Enclave Tls server
mkdir -p enclave_tls_src
pushd enclave_tls_src
git clone https://github.com/alibaba/inclavare-containers
cd inclavare-containers/enclave-tls && make OCCLUM=1 && make install
popd

@ -0,0 +1,20 @@
#!/bin/bash
set -e
# 1. Init Occlum Workspace
rm -rf occlum_workspace
mkdir occlum_workspace
cd occlum_workspace
occlum init
# 2. Copy files into Occlum Workspace and Build
cp -f /opt/enclave-tls/bin/enclave-tls-server image/bin
cp -f /opt/occlum/glibc/lib/libdl.so.2 image/opt/occlum/glibc/lib
mkdir -p image/opt/enclave-tls
cp -rf /opt/enclave-tls/lib image/opt/enclave-tls
# The following libs are required by libenclave_quote_sgx_ecdsa.so
cp /usr/lib/x86_64-linux-gnu/libsgx_dcap_quoteverify.so.1 image/opt/occlum/glibc/lib
occlum build
# 3. Run enclave_tls_server
occlum run /bin/enclave-tls-server