You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to add FTP together with SSL myself as suggested by #1488 but it doesn't work for me properly, and after couple of days of debugging I'm lost.
I'm getting SSL_read on shutdown: error:0A000126:SSL routines::unexpected eof while reading in /ftp_test.php
Normally I'm using https://github.com/dg/ftp-deployment, but to mitigate risk that issue lives in that library, I prepared simple script and getting same result.
In the script below I'm getting that error on line with ftp_close($conn). If I delete that line, I get same error on line with unset($conn)
$url = parse_url("ftps://host.net/path/to/test/folder");
// Connect$conn = ftp_ssl_connect($url["host"], 21) ordie("Could not connect to");
ftp_login($conn, "username", "pass") ordie("fail to login");
ftp_set_option($conn, FTP_USEPASVADDRESS, false) ordie("fail to set option");
ftp_pasv($conn, true) ordie("fail to set passive mode");
ftp_chdir($conn, $url['path']) ordie("fail to change directory");
// Upload file$path = "test-".date("Y-m-d_H-i-s").".txt";
file_put_contents($path, "test");
ftp_put($conn, $path, $path, FTP_BINARY) ordie("fail to upload");
sleep(5);
ftp_close($conn) ordie("fail to close");
unset($conn);
echo"done";
My Alpine Dockerfile is
FROM php:8.3-alpine
RUN apk update \
&& apk add --no-cache openssl-dev make git bash lftp coreutils
RUN docker-php-ext-configure ftp --with-openssl-dir=/usr \
&& docker-php-ext-install ftp
but I also tried non-alpine PHP image but with same result
FROM php:8.3
RUN apt-get update \
&& apt-get install -y libssl-dev make git bash lftp coreutils
RUN docker-php-ext-configure ftp --with-openssl-dir=/usr \
&& docker-php-ext-install ftp
The text was updated successfully, but these errors were encountered:
So it actually works as expected (the Docker part). Because I'm getting same error even if I run that script locally on my machine with pure PHP installation.
I still struggle and I have no idea what is wrong. Especially because it happening on some FTP servers and not on others. But this is not Docker issue, so closing.
I'm trying to add FTP together with SSL myself as suggested by #1488 but it doesn't work for me properly, and after couple of days of debugging I'm lost.
I'm getting
SSL_read on shutdown: error:0A000126:SSL routines::unexpected eof while reading in /ftp_test.php
Normally I'm using https://github.com/dg/ftp-deployment, but to mitigate risk that issue lives in that library, I prepared simple script and getting same result.
In the script below I'm getting that error on line with
ftp_close($conn)
. If I delete that line, I get same error on line withunset($conn)
My Alpine Dockerfile is
but I also tried non-alpine PHP image but with same result
The text was updated successfully, but these errors were encountered: