ADD Enclave TLS Server demo
This commit is contained in:
parent
4395ec7f81
commit
0c0c4c4abc
20
demos/enclave_tls/README.md
Normal file
20
demos/enclave_tls/README.md
Normal file
@ -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.
|
9
demos/enclave_tls/download_and_build_enclave_tls.sh
Executable file
9
demos/enclave_tls/download_and_build_enclave_tls.sh
Executable file
@ -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
|
20
demos/enclave_tls/run_enclave_tls_server_in_occlum.sh
Executable file
20
demos/enclave_tls/run_enclave_tls_server_in_occlum.sh
Executable file
@ -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
|
Loading…
Reference in New Issue
Block a user