报错内容如下:
src/event/ngx_event_openssl.c: 在函数‘ngx_ssl_init’中:
src/event/ngx_event_openssl.c:112:5: 警告:不建议使用‘OPENSSL_config’(声明于 /usr/local/openssl-1.1.1-pre9/.openssl/include/openssl/conf.h:91) [-Wdeprecated-declarations]
OPENSSL_config(NULL);
^
src/event/ngx_event_openssl.c: 在函数‘ngx_ssl_rsa512_key_callback’中:
src/event/ngx_event_openssl.c:753:9: 警告:不建议使用‘RSA_generate_key’(声明于 /usr/local/openssl-1.1.1-pre9/.openssl/include/openssl/rsa.h:234) [-Wdeprecated-declarations]
key = RSA_generate_key(512, RSA_F4, NULL, NULL);
^
src/event/ngx_event_openssl.c: 在函数‘ngx_ssl_dhparam’中:
src/event/ngx_event_openssl.c:943:11: 错误:提领指向不完全类型的指针
dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
^
src/event/ngx_event_openssl.c:944:11: 错误:提领指向不完全类型的指针
dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
^
src/event/ngx_event_openssl.c:946:15: 错误:提领指向不完全类型的指针
if (dh->p == NULL || dh->g == NULL) {
^
src/event/ngx_event_openssl.c:946:32: 错误:提领指向不完全类型的指针
if (dh->p == NULL || dh->g == NULL) {
^
src/event/ngx_event_openssl.c: 在函数‘ngx_ssl_connection_error’中:
src/event/ngx_event_openssl.c:1917:21: 错误:‘SSL_R_NO_CIPHERS_PASSED’未声明(在此函数内第一次使用)
|| n == SSL_R_NO_CIPHERS_PASSED /* 182 */
^
src/event/ngx_event_openssl.c:1917:21: 附注:每个未声明的标识符在其出现的函数内只报告一次
src/event/ngx_event_openssl.c: 在函数‘ngx_ssl_session_cache’中:
src/event/ngx_event_openssl.c:2111:9: 警告:传递‘SSL_CTX_sess_set_get_cb’的第 2 个参数时在不兼容的指针类型间转换 [默认启用]
SSL_CTX_sess_set_get_cb(ssl->ctx, ngx_ssl_get_cached_session);
^
In file included from src/event/ngx_event_openssl.h:15:0,
from src/core/ngx_core.h:82,
from src/event/ngx_event_openssl.c:9:
/usr/local/openssl-1.1.1-pre9/.openssl/include/openssl/ssl.h:707:6: 附注:需要类型‘struct SSL_SESSION * (*)(struct ssl_st *, const unsigned char *, int, int *)’,但实参的类型为‘struct SSL_SESSION * (*)(struct SSL *, u_char *, int, int *)’
void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx,
^
src/event/ngx_event_openssl.c: 在函数‘ngx_ssl_session_id_context’中:
src/event/ngx_event_openssl.c:2133:27: 错误:‘md’的存储大小未知
EVP_MD_CTX md;
^
src/event/ngx_event_openssl.c:2199:5: 警告:隐式声明函数‘EVP_MD_CTX_cleanup’ [-Wimplicit-function-declaration]
EVP_MD_CTX_cleanup(&md);
^
src/event/ngx_event_openssl.c:2133:27: 警告:未使用的变量‘md’ [-Wunused-variable]
EVP_MD_CTX md;
^
make[1]: *** [objs/src/event/ngx_event_openssl.o] 错误 1
make[1]: 离开目录“/usr/local/nginx-1.9.9”
make: *** [build] 错误 2
这个应该是openssl和nginx版本不匹配导致的,我把版本换成nginx-1.17.9和openssl-1.1.1d然后就不报错了