Skip to content

Commit d2ee084

Browse files
committed
don't depend on ext/openssl for ftp ssl support
instead just link against the openssl and init manually, that's more flexible
1 parent 4ee0395 commit d2ee084

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

ext/ftp/php_ftp.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -281,22 +281,10 @@ const zend_function_entry php_ftp_functions[] = {
281281
PHP_FE_END
282282
};
283283

284-
#ifdef HAVE_FTP_SSL
285-
/* {{{ ftp_deps */
286-
static const zend_module_dep ftp_deps[] = {
287-
ZEND_MOD_REQUIRED("openssl")
288-
{NULL, NULL, NULL}
289-
};/*}}}*/
290-
#endif
291-
292284
zend_module_entry php_ftp_module_entry = {
293285
STANDARD_MODULE_HEADER_EX,
294286
NULL,
295-
#ifdef HAVE_FTP_SSL
296-
ftp_deps,
297-
#else
298287
NULL,
299-
#endif
300288
"ftp",
301289
php_ftp_functions,
302290
PHP_MINIT(ftp),
@@ -321,6 +309,15 @@ static void ftp_destructor_ftpbuf(zend_resource *rsrc)
321309

322310
PHP_MINIT_FUNCTION(ftp)
323311
{
312+
#ifdef HAVE_FTP_SSL
313+
SSL_library_init();
314+
OpenSSL_add_all_ciphers();
315+
OpenSSL_add_all_digests();
316+
OpenSSL_add_all_algorithms();
317+
318+
SSL_load_error_strings();
319+
#endif
320+
324321
le_ftpbuf = zend_register_list_destructors_ex(ftp_destructor_ftpbuf, NULL, le_ftpbuf_name, module_number);
325322
REGISTER_LONG_CONSTANT("FTP_ASCII", FTPTYPE_ASCII, CONST_PERSISTENT | CONST_CS);
326323
REGISTER_LONG_CONSTANT("FTP_TEXT", FTPTYPE_ASCII, CONST_PERSISTENT | CONST_CS);

0 commit comments

Comments
 (0)