-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TLS performance extensions #614
Comments
TLS is widespread nowadays, so the performance issue is crucial and must be in scope of 0.5. |
Preliminary performance results for TLS default benchmark in 2-CPU VM for proxy mode. Note: wrk uses keep-alive connections, so stream encryption is mostly tested in this scenario. ./wrk -c 4096 -t 8 -d 30 https://192.168.100.4:443/
Running 30s test @ https://192.168.100.4:443/
8 threads and 4096 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 545.38ms 457.87ms 2.00s 80.11%
Req/Sec 78.52 109.64 0.98k 89.19%
5484 requests in 30.15s, 6.81MB read
Socket errors: connect 11333, read 0, write 0, timeout 935
Requests/sec: 181.87
Transfer/sec: 231.42KB
Cached mode has even lower performance:
Measurements for Nginx 1.10.3 with OpenSSL 1.1.0d in default configuration
|
Running wrk with wrong protocol specification (http instead of https)
causes many handshake errors without freeing skb, which leads to OOM. |
TLS is hard to debug due to random data, so orig_tls_dbg.diff.gz patch for current master with almost unmodified mbedTLS is required to make the TLS data constant. OpenSSL even with |
Task #81 was implemented by porting mbedTLS as is, i.e. with all buffering and copies. See comments in #603, #596 and #595 . The module must use in-place encryption and decryption.
Modern Linux kernels implement almost all crypto algorithms (maybe just except ECDSA) required for TLS. So it has sense to port mbed TLS handshake only to the kernel and use standard Linux crypto for encryption. Moreover, Linux 4.13 implements TLS, so moving to recent kernel is required. Only TLS handshake and infrastructure code must be taken from mbed TLS, while Linux code must be used for symmetric crypto. Full TLS (#769) must be kept in mind during the library adjustments.
Also current TLS code is based on mbedTLS 2.2 and must be updated to latest GPL version (currently 2.6), which has many security fixes.
It seems special hooks at handshake code are required to implement SSL/TLS Renegotiation DoS protection (#832).
Good reference article about TLS DDoS mitigation SSL computational DoS mitigation.
The text was updated successfully, but these errors were encountered: