|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-01-14 16:28 UTC] toppi at kacke dot de
Trying to tls://ftp_ip:port ... Warning: fsockopen() [function.fsockopen]: php_stream_sock_ssl_activate_with_method: SSL handshake/connection failed in ftpclass.php on line 204 Warning: fsockopen() [function.fsockopen]: failed to activate SSL mode 2 in ftpclass.php on line 204 The TLS SERVER replies tru fread() at least : UK (glftpd 1.28_Linux+TLS) ready. 500 '': Command not understood. I would expect when using a tls-prefix its working similare to ftp_ssl_connect (what is working fine but not needed cause no filepointer back). No chance in php to connect ftp+tls tru fsock which is needed if you need a filepointer back to use fread/write etc. Greetings Toppi PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 07:00:01 2025 UTC |
this is expected behaviour; fsockopen("tls://") opens the socket with TLS turned on. By default, TLS-enabled ftp servers start "in the clear" - with crypto turned off. If you want to use TLS over ftp, consider using fopen("ftps://") instead (which will attempt TLS negotiation according to the relevant rfcs), or if that is not sufficient, try using the curl functions.Hi Wez, i know this prolly no faq here but im sticky since days on it and i didnt get help anywhere yet, so excuse my last question in this thread please. example: <?PHP $sock = fsockopen($server, $port, $errno, $errstr, timeout); fgets($sock....); if TLS then { frwite (ftp, "AUTH", "TLS")) //to use php_stream_api or streams and options //and swtich into ssl mode ? like php.ftp it does ? // ctx = SSL_CTX_new(SSLv23_client_method()); ????? //or a simple stream wrapper from php frwite(ftp, "PBSZ") . ...and so on..... } ?> a simple "yes" or "no" from your side would be enough, so ill try to figure it out by myself. Maybe theres something easie php-trick i dont know, to solve this problem. Also theres no help available on the web to it. Im sorry to waste your time in here , but its realy importand to realize it in php. Toppi