GmSSL 3之后的版本,如何源码编译nginx
GmSSL 3之后的版本没有ssl.h文件,编译nginx时会报错:
#16 3.081 make -f objs/Makefile #16 3.086 make[1]: Entering directory '/build/nginx' #16 3.086 make[1]: Leaving directory '/build/nginx' #16 3.086 make[1]: *** No rule to make target '/build/GmSSL/build/include/openssl/ssl.h', needed by 'objs/src/core/nginx.o'. Stop. #16 3.086 make: *** [Makefile:10: build] Error 2 #16 ERROR: process "/bin/sh -c cd nginx && cp auto/configure ./ && ./configure --with-http_ssl_module --without-http_upstream_zone_module --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-http_v2_module --with-openssl="/build/GmSSL/build" && make && make install" did not complete successfully: exit code: 2
[builder 10/10] RUN cd nginx && cp auto/configure ./ && ./configure --with-http_ssl_module --without-http_upstream_zone_module --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-http_v2_module --with-openssl="/build/GmSSL/build" && make && make install: 3.079 nginx http proxy temporary files: "proxy_temp" 3.079 nginx http fastcgi temporary files: "fastcgi_temp" 3.079 nginx http uwsgi temporary files: "uwsgi_temp" 3.079 nginx http scgi temporary files: "scgi_temp" 3.079 3.081 make -f objs/Makefile 3.086 make[1]: Entering directory '/build/nginx' 3.086 make[1]: Leaving directory '/build/nginx' 3.086 make[1]: *** No rule to make target '/build/GmSSL/build/include/openssl/ssl.h', needed by 'objs/src/core/nginx.o'. Stop. 3.086 make: *** [Makefile:10: build] Error 2
目前来看,无法规避掉,是否只有去改nginx源码一条道?
可以用这个项目里面的文件替换一下试试:
https://github.com/GmSSL/OpenSSL-Compatibility-Layer/tree/main/include/openssl