-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support SSL/TLS async mode in Nginx based on Nginx-1.10.3 release
- Loading branch information
Changzheng Wei
committed
Jan 8, 2018
0 parents
commit be101f7
Showing
431 changed files
with
185,293 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (C) 2002-2016 Igor Sysoev | ||
* Copyright (C) 2011-2016 Nginx, Inc. | ||
* Copyright (C) 2014-2017 Intel, Inc. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
* SUCH DAMAGE. | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
# Intel® QuickAssist Technology (QAT) Async Mode Nginx | ||
|
||
## Table of Contents | ||
|
||
- [Introduction](#introduction) | ||
- [Licensing](#licensing) | ||
- [Features](#features) | ||
- [Hardware Requirements](#hardware-requirements) | ||
- [Software Requirements](#software-requirements) | ||
- [Additional Information](#additional-information) | ||
- [Limitations](#limitations) | ||
- [Installation Instructions](#installation-instructions) | ||
- [Install Async Mode Nginx](#install-async-mode-nginx) | ||
- [Build OpenSSL\* and QAT engine](#build-openssl-and-qat-engine) | ||
- [Intended Audience](#intended-audience) | ||
- [Legal](#legal) | ||
|
||
## Introduction | ||
|
||
Nginx\* [engine x] is an HTTP and reverse proxy server, a mail proxy server, | ||
and a generic TCP/UDP proxy server, originally written by Igor Sysoev. | ||
This project provides an extended Nginx working with asynchronous mode OpenSSL\*. | ||
With Intel® QuickAssist Technology(QAT) acceleration, the asynchronous mode Nginx | ||
can provide significant performance improvement. | ||
|
||
## Licensing | ||
|
||
The Licensing of the files within this project is: | ||
|
||
Intel® Quickassist Technology (QAT) Async Mode Nginx - BSD License. Please | ||
see the `LICENSE` file contained in the top level folder. Further details can | ||
be found in the file headers of the relevant files. | ||
|
||
## Features | ||
|
||
* Asynchronous Mode in SSL/TLS processing | ||
|
||
## Hardware Requirements | ||
|
||
Async Mode Nginx supports Crypto offload to the following acceleration devices: | ||
|
||
* Intel® C62X Series Chipset | ||
* [Intel® Communications Chipset 8925 to 8955 Series][1] | ||
|
||
[1]:https://www.intel.com/content/www/us/en/ethernet-products/gigabit-server-adapters/quickassist-adapter-8950-brief.html | ||
|
||
## Software Requirements | ||
|
||
This release was validated on the following: | ||
|
||
* OpenSSL-1.1.0f | ||
* QAT engine v0.5.30 | ||
|
||
## Additional Information | ||
|
||
* Async Mode Nginx SSL engine framework provides new directives: | ||
|
||
**Directives** | ||
```bash | ||
Syntax: ssl_asynch on | off; | ||
Default: ssl_asynch off; | ||
Context: http, server | ||
|
||
Enables SSL/TLS asynchronous mode | ||
``` | ||
**Example** | ||
|
||
file: conf/nginx.conf | ||
|
||
```bash | ||
http { | ||
ssl_asynch on; | ||
server { | ||
... | ||
} | ||
} | ||
} | ||
``` | ||
|
||
```bash | ||
http { | ||
server { | ||
ssl_asynch on; | ||
} | ||
} | ||
} | ||
``` | ||
|
||
* [White Paper: Intel® Quickassist Technology and OpenSSL-1.1.0:Performance][2] | ||
|
||
[2]: https://01.org/sites/default/files/downloads/intelr-quickassist-technology/intelquickassisttechnologyopensslperformance.pdf | ||
|
||
## Limitations | ||
|
||
* Nginx supports `reload` operation, when QAT hardware is involved for crypto | ||
offload, user should enure that there are enough number of qat instances. | ||
For example, the available qat instance number should be 2x equal or more than | ||
Nginx worker process number. | ||
|
||
For example, in Nginx configuration file (`nginx.conf`) worker process number | ||
is configured as | ||
|
||
```bash | ||
worker_processes 16; | ||
``` | ||
|
||
Then the instance configuration in QAT driver configuration file should be | ||
|
||
```bash | ||
[SHIM] | ||
NumberCyInstances = 1 | ||
NumberDcInstances = 0 | ||
NumProcesses = 32 | ||
LimitDevAccess = 1 | ||
``` | ||
|
||
## Installation Instructions | ||
|
||
### Install Async Mode Nginx | ||
|
||
**Set the following environmental variables:** | ||
|
||
`NGINX_INSTALL_DIR` is the directory where nginx will be installed to | ||
|
||
`OPENSSL_LIB` is the directory where the openssl has been installed to | ||
|
||
**Configure nginx for compilation:** | ||
|
||
```bash | ||
./configure \ | ||
--prefix=$NGINX_INSTALL_DIR \ | ||
--with-http_ssl_module \ | ||
--with-cc-opt="-DNGX_SECURE_MEM -I$OPENSSL_LIB/include -Wno-error=deprecated-declarations" \ | ||
--with-ld-opt="-Wl,-rpath=$OPENSSL_LIB/lib -L$OPENSSL_LIB/lib" | ||
``` | ||
|
||
**Compile and Install:** | ||
|
||
```bash | ||
make | ||
make install | ||
``` | ||
|
||
### Build OpenSSL\* and QAT engine | ||
|
||
These instructions can be found on [QAT engine][4] | ||
|
||
[4]: https://github.com/intel/QAT_Engine#installation-instructions | ||
|
||
|
||
## Intended Audience | ||
|
||
The target audience may be software developers, test and validation engineers, | ||
system integrators, end users and consumers for Async Mode Nginx integrated | ||
Intel® Quick Assist Technology. | ||
|
||
## Legal | ||
|
||
Intel® disclaims all express and implied warranties, including without | ||
limitation, the implied warranties of merchantability, fitness for a | ||
particular purpose, and non-infringement, as well as any warranty arising | ||
from course of performance, course of dealing, or usage in trade. | ||
|
||
This document contains information on products, services and/or processes in | ||
development. All information provided here is subject to change without | ||
notice. Contact your Intel® representative to obtain the latest forecast | ||
, schedule, specifications and roadmaps. | ||
|
||
The products and services described may contain defects or errors known as | ||
errata which may cause deviations from published specifications. Current | ||
characterized errata are available on request. | ||
|
||
Copies of documents which have an order number and are referenced in this | ||
document may be obtained by calling 1-800-548-4725 or by visiting | ||
www.intel.com/design/literature.htm. | ||
|
||
Intel, the Intel logo are trademarks of Intel Corporation in the U.S. | ||
and/or other countries. | ||
|
||
\*Other names and brands may be claimed as the property of others | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
# Copyright (C) Igor Sysoev | ||
# Copyright (C) Nginx, Inc. | ||
|
||
|
||
# aCC: HP ANSI C++ B3910B A.03.55.02 | ||
|
||
# C89 mode | ||
|
||
CFLAGS="$CFLAGS -Ae" | ||
CC_TEST_FLAGS="-Ae" | ||
|
||
PCRE_OPT="$PCRE_OPT -Ae" | ||
ZLIB_OPT="$ZLIB_OPT -Ae" | ||
MD5_OPT="$MD5_OPT -Ae" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
|
||
# Copyright (C) Igor Sysoev | ||
# Copyright (C) Nginx, Inc. | ||
|
||
|
||
# Borland C++ 5.5 | ||
|
||
# optimizations | ||
|
||
# maximize speed | ||
CFLAGS="$CFLAGS -O2" | ||
|
||
case $CPU in | ||
pentium) | ||
# optimize for Pentium and Athlon | ||
CPU_OPT="-5" | ||
;; | ||
|
||
pentiumpro) | ||
# optimize for Pentium Pro, Pentium II and Pentium III | ||
CPU_OPT="-6" | ||
;; | ||
esac | ||
|
||
# __stdcall | ||
#CPU_OPT="$CPU_OPT -ps" | ||
# __fastcall | ||
#CPU_OPT="$CPU_OPT -pr" | ||
|
||
CFLAGS="$CFLAGS $CPU_OPT" | ||
|
||
# multithreaded | ||
CFLAGS="$CFLAGS -tWM" | ||
|
||
# stop on warning | ||
CFLAGS="$CFLAGS -w!" | ||
|
||
# disable logo | ||
CFLAGS="$CFLAGS -q" | ||
|
||
|
||
# precompiled headers | ||
CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.csm" | ||
NGX_PCH="$NGX_OBJS/ngx_config.csm" | ||
NGX_BUILD_PCH="-H=$NGX_OBJS/ngx_config.csm" | ||
NGX_USE_PCH="-Hu -H=$NGX_OBJS/ngx_config.csm" | ||
|
||
|
||
# Win32 GUI mode application | ||
#LINK="\$(CC) -laa" | ||
|
||
|
||
# the resource file | ||
NGX_RES="$NGX_OBJS/nginx.res" | ||
NGX_RCC="brcc32 -fo$NGX_OBJS/nginx.res \$(CORE_INCS) $NGX_WIN32_RC" | ||
# the pragma allows to link the resource file using bcc32 and | ||
# to avoid the direct ilink32 calling and the c0w32.obj's WinMain/main problem | ||
NGX_PRAGMA="#pragma resource \"$NGX_OBJS/nginx.res\"" | ||
|
||
|
||
ngx_include_opt="-I" | ||
ngx_objout="-o" | ||
ngx_binout="-e" | ||
ngx_objext="obj" | ||
ngx_binext=".exe" | ||
|
||
ngx_long_start='@&&| | ||
' | ||
ngx_long_end='|' | ||
|
||
ngx_regex_dirsep='\\' | ||
ngx_dirsep="\\" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
# Copyright (C) Igor Sysoev | ||
# Copyright (C) Nginx, Inc. | ||
|
||
|
||
# Compaq C V6.5-207 | ||
|
||
ngx_include_opt="-I" | ||
|
||
# warnings | ||
|
||
CFLAGS="$CFLAGS -msg_enable level6 -msg_fatal level6" | ||
|
||
CFLAGS="$CFLAGS -msg_disable unknownmacro" | ||
CFLAGS="$CFLAGS -msg_disable unusedincl" | ||
CFLAGS="$CFLAGS -msg_disable unnecincl" | ||
CFLAGS="$CFLAGS -msg_disable nestincl" | ||
CFLAGS="$CFLAGS -msg_disable strctpadding" | ||
CFLAGS="$CFLAGS -msg_disable ansialiascast" | ||
CFLAGS="$CFLAGS -msg_disable inlinestoclsmod" | ||
CFLAGS="$CFLAGS -msg_disable cxxkeyword" | ||
CFLAGS="$CFLAGS -msg_disable longlongsufx" | ||
CFLAGS="$CFLAGS -msg_disable valuepres" | ||
|
||
# STUB | ||
CFLAGS="$CFLAGS -msg_disable truncintcast" | ||
CFLAGS="$CFLAGS -msg_disable trunclongcast" | ||
|
||
CFLAGS="$CFLAGS -msg_disable truncintasn" | ||
CFLAGS="$CFLAGS -msg_disable trunclongint" | ||
CFLAGS="$CFLAGS -msg_disable intconcastsgn" | ||
CFLAGS="$CFLAGS -msg_disable intconstsign" | ||
CFLAGS="$CFLAGS -msg_disable switchlong" | ||
CFLAGS="$CFLAGS -msg_disable subscrbounds2" | ||
|
||
CFLAGS="$CFLAGS -msg_disable hexoctunsign" | ||
|
||
CFLAGS="$CFLAGS -msg_disable ignorecallval" | ||
CFLAGS="$CFLAGS -msg_disable nonstandcast" | ||
CFLAGS="$CFLAGS -msg_disable embedcomment" | ||
CFLAGS="$CFLAGS -msg_disable unreachcode" | ||
CFLAGS="$CFLAGS -msg_disable questcompare2" | ||
CFLAGS="$CFLAGS -msg_disable unusedtop" | ||
CFLAGS="$CFLAGS -msg_disable unrefdecl" | ||
|
||
CFLAGS="$CFLAGS -msg_disable bitnotint" |
Oops, something went wrong.