@@ -21,6 +21,10 @@ Currently, the following operations are supported:
2121
2222Configuration is done via environment variables:
2323
24+ ### Required Settings
25+
26+ - ` APP_MODE ` - Application mode (required, must be either "enclaved" or "master-express")
27+
2428### Network Settings
2529
2630- ` PORT ` - Port to listen on (default: 3080)
@@ -36,10 +40,20 @@ Configuration is done via environment variables:
3640- ` MTLS_REJECT_UNAUTHORIZED ` - Whether to reject unauthorized connections (default: false)
3741- ` MTLS_ALLOWED_CLIENT_FINGERPRINTS ` - Comma-separated list of allowed client certificate fingerprints (optional)
3842
43+ ### Master Express Settings
44+
45+ - ` BITGO_PORT ` - Port to listen on (default: 3080)
46+ - ` BITGO_BIND ` - Address to bind to (default: localhost)
47+ - ` BITGO_ENV ` - Environment name (default: test)
48+ - ` BITGO_ENABLE_SSL ` - Enable SSL and certificate verification (default: true)
49+ - ` BITGO_ENABLE_PROXY ` - Enable proxy (default: true)
50+ - ` ENCLAVED_EXPRESS_URL ` - URL of the enclaved express server (required)
51+ - ` ENCLAVED_EXPRESS_SSL_CERT ` - Path to the enclaved express server's SSL certificate (required)
52+
3953### Other Settings
4054
4155- ` LOGFILE ` - Path to log file (optional)
42- - ` DEBUG ` - Debug namespaces to enable (e.g., 'enclaved:* ')
56+ - ` DEBUG ` - Debug namespaces to enable (e.g., 'enclaved:\ * ')
4357
4458## Running Enclaved Express
4559
@@ -54,34 +68,44 @@ yarn start --port 3080
5468For testing purposes, you can use self-signed certificates with relaxed verification:
5569
5670``` bash
71+ APP_MODE=enclaved \
72+ MASTER_BITGO_EXPRESS_PORT=3080 \
73+ MASTER_BITGO_EXPRESS_BIND=localhost \
5774MASTER_BITGO_EXPRESS_KEYPATH=./test-ssl-key.pem \
5875MASTER_BITGO_EXPRESS_CRTPATH=./test-ssl-cert.pem \
5976MTLS_ENABLED=true \
6077MTLS_REQUEST_CERT=true \
6178MTLS_REJECT_UNAUTHORIZED=false \
62- yarn start --port 3080
79+ yarn start
6380```
6481
65- ### Connecting from Regular Express
82+ ### Connecting from Master Express
6683
67- To connect to Enclaved Express from the regular Express server:
84+ To connect to Enclaved Express from the Master Express server:
6885
6986``` bash
70- yarn start --port 4000 \
71- --enclavedExpressUrl=' https://localhost:3080' \
72- --enclavedExpressSSLCert=' ./test-ssl-cert.pem' \
73- --disableproxy \
74- --debug
87+ APP_MODE=master-express \
88+ BITGO_PORT=3080 \
89+ BITGO_BIND=localhost \
90+ BITGO_ENV=test \
91+ BITGO_KEYPATH=./test-ssl-key.pem \
92+ BITGO_CRTPATH=./test-ssl-cert.pem \
93+ ENCLAVED_EXPRESS_URL=https://localhost:4000 \
94+ ENCLAVED_EXPRESS_SSL_CERT=./enclaved-express-cert.pem \
95+ BITGO_ENABLE_SSL=false \
96+ yarn start
7597```
7698
7799## Understanding mTLS Configuration
78100
79101### Server Side (Enclaved Express)
102+
80103- Uses both certificate and key files
81104- The key file (` test-ssl-key.pem ` ) is used to prove the server's identity
82105- The certificate file (` test-ssl-cert.pem ` ) is what the server presents to clients
83106
84107### Client Side (Regular Express)
108+
85109- For testing, only needs the server's certificate
86110- ` rejectUnauthorized: false ` allows testing without strict certificate verification
87111- In production, proper client certificates should be used
@@ -101,11 +125,13 @@ yarn start --port 4000 \
101125### Common Issues
102126
1031271 . ** Certificate Errors**
128+
104129 - Ensure paths to certificate files are correct
105130 - Check file permissions on certificate files
106131 - Verify certificate format is correct
107132
1081332 . ** Connection Issues**
134+
109135 - Verify ports are not in use
110136 - Check firewall settings
111137 - Ensure URLs are correct (including https:// prefix)
@@ -117,4 +143,4 @@ yarn start --port 4000 \
117143
118144## License
119145
120- MIT
146+ MIT
0 commit comments