unbit / uwsgi

uWSGI application server container
http://projects.unbit.it/uwsgi
Other
3.45k stars 691 forks source link

compiling uwsgi with openssl 1.1.1; undefined reference to OPENSSL_add_all_algorithms_noconf #2355

Closed sandeep-gh closed 3 years ago

sandeep-gh commented 3 years ago

I am compiling uwsgi with openssl 1.1.1 (need to use with python 3.10). The compiler throws undef refrence to OPENSSL_add_all_algorithms_noconf. However, I don't see any reference to OPENSSL_add_all_algorithms_noconf from function uwsgi_ssl_init:

void uwsgi_ssl_init(void) {?                                                                                                                                                                     
#if OPENSSL_VERSION_NUMBER < 0x10100000L?                                                                                                                                                        
        OPENSSL_config(NULL);?                                                                                                                                                                   
#endif?                                                                                                                                                                                         
        //OPENSSL_init_ssl();?                                                                                                                                                                   
        //SSL_load_error_strings();?                                                                                                                                                             
        OpenSSL_add_all_algorithms();?                                                                                                                                                         
        uwsgi.ssl_initialized = 1;?                                                                                                                                                             
}?

Is this an OpenSSL issue and not uwsgi issue?

Below is the compiler output.

*** uWSGI linking ***
cc -pthread -o uwsgi  core/utils.o core/protocol.o core/socket.o core/logging.o core/master.o core/master_utils.o core/emperor.o core/notify.o core/mule.o core/subscription.o core/stats.o core/se
ndfile.o core/async.o core/master_checks.o core/fifo.o core/offload.o core/io.o core/static.o core/websockets.o core/spooler.o core/snmp.o core/exceptions.o core/config.o core/setup_utils.o core/
clock.o core/init.o core/buffer.o core/reader.o core/writer.o core/alarm.o core/cron.o core/hooks.o core/plugins.o core/lock.o core/cache.o core/daemons.o core/errors.o core/hash.o core/master_ev
ents.o core/chunked.o core/queue.o core/event.o core/signal.o core/strings.o core/progress.o core/timebomb.o core/ini.o core/fsmon.o core/mount.o core/metrics.o core/plugins_builder.o core/shared
area.o core/fork_server.o core/webdav.o core/zeus.o core/rpc.o core/gateway.o core/loop.o core/cookie.o core/querystring.o core/rb_timers.o core/transformations.o core/uwsgi.o proto/base.o proto/
uwsgi.o proto/http.o proto/fastcgi.o proto/scgi.o proto/puwsgi.o core/zlib.o core/regexp.o core/routing.o core/yaml.o core/json.o core/ssl.o core/legion.o core/xmlconf.o core/dot_h.o core/config_
py.o plugins/python/python_plugin.o plugins/python/pyutils.o plugins/python/pyloader.o plugins/python/wsgi_handlers.o plugins/python/wsgi_headers.o plugins/python/wsgi_subhandler.o plugins/python
/web3_subhandler.o plugins/python/pump_subhandler.o plugins/python/gil.o plugins/python/uwsgi_pymodule.o plugins/python/profiler.o plugins/python/symimporter.o plugins/python/tracebacker.o plugin
s/python/raw.o plugins/gevent/gevent.o plugins/gevent/hooks.o plugins/ping/ping_plugin.o plugins/cache/cache.o plugins/nagios/nagios.o plugins/rrdtool/rrdtool.o plugins/carbon/carbon.o plugins/rp
c/rpc_plugin.o plugins/corerouter/cr_common.o plugins/corerouter/cr_map.o plugins/corerouter/corerouter.o plugins/fastrouter/fastrouter.o plugins/http/http.o plugins/http/keepalive.o plugins/http
/https.o plugins/http/spdy3.o plugins/signal/signal_plugin.o plugins/syslog/syslog_plugin.o plugins/rsyslog/rsyslog_plugin.o plugins/logsocket/logsocket_plugin.o plugins/router_uwsgi/router_uwsgi
.o plugins/router_redirect/router_redirect.o plugins/router_basicauth/router_basicauth.o plugins/zergpool/zergpool.o plugins/redislog/redislog_plugin.o plugins/mongodblog/mongodblog_plugin.o plug
ins/router_rewrite/router_rewrite.o plugins/router_http/router_http.o plugins/logfile/logfile.o plugins/router_cache/router_cache.o plugins/rawrouter/rawrouter.o plugins/router_static/router_stat
ic.o plugins/sslrouter/sslrouter.o plugins/spooler/spooler_plugin.o plugins/cheaper_busyness/cheaper_busyness.o plugins/symcall/symcall_plugin.o plugins/transformation_tofile/tofile.o plugins/tra
nsformation_gzip/gzip.o plugins/transformation_chunked/chunked.o plugins/transformation_offload/offload.o plugins/router_memcached/router_memcached.o plugins/router_redis/router_redis.o plugins/r
outer_hash/router_hash.o plugins/router_expires/expires.o plugins/router_metrics/plugin.o plugins/transformation_template/tt.o plugins/stats_pusher_socket/plugin.o plugins/router_fcgi/router_fcgi
.o -lpthread -lm -rdynamic -lexecinfo -lz -lkvm -L/usr/local/lib -Wl,-R/usr/local/lib -lpcre -L/usr/local/lib -ljansson -lssl -lcrypto -L/usr/local/lib -lxml2 -lz -L/usr/local/lib -llzma -lpthrea
d -L/usr/local/lib -liconv -lm -lpthread -lutil -lm -lm /home/shared/Builds/Python-3.10.0/lib/python3.10/config-3.10/libpython3.10.a -lutil
ld: error: undefined symbol: OPENSSL_add_all_algorithms_noconf
>>> referenced by ssl.c
>>>               core/ssl.o:(uwsgi_ssl_init)
>>> referenced by ssl.c
>>>               core/ssl.o:(uwsgi_rsa_sign)
>>> referenced by ssl.c
>>>               core/ssl.o:(uwsgi_opt_sni)
>>> referenced 1 more times

ld: error: undefined symbol: SSLv23_server_method
>>> referenced by ssl.c
>>>               core/ssl.o:(uwsgi_ssl_new_server_context)

ld: error: undefined symbol: SSL_CTX_get_ex_new_index
>>> referenced by https.c
>>>               plugins/http/https.o:(uwsgi_opt_https2)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** error linking uWSGI ***
*** Error 1 in /home/shared/downloads/uwsgi (Makefile:4 'all')
pi4bsdm2% 
sandeep-gh commented 3 years ago

fixed, i think. Openssl has provided #define directive to all the deprecated functions. But for some reason compiler doesn't pick those up. New set of changes here : https://github.com/sandeep-gh/uwsgi