<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>Unity Behind Diversity &#187; tls</title>
	<atom:link href="http://blaise.ca/blog/tag/tls/feed/" rel="self" type="application/rss+xml" />
	<link>http://blaise.ca/blog</link>
	<description>Searching for beauty in the dissonance</description>
	<lastBuildDate>Tue, 07 Feb 2012 13:35:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.5/ca/</creativeCommons:license>		<item>
		<title>FIXED: PHP Warning: ftp_login(): AUTH not understood</title>
		<link>http://blaise.ca/blog/2009/06/02/fixed-php-warning-ftp_login-auth-not-understood/</link>
		<comments>http://blaise.ca/blog/2009/06/02/fixed-php-warning-ftp_login-auth-not-understood/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 06:30:41 +0000</pubDate>
		<dc:creator>Blaise Alleyne</dc:creator>
				<category><![CDATA[Free Software]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[ftp_login]]></category>
		<category><![CDATA[ftp_ssl_connect]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[proftpd]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[tls]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://blaise.ca/blog/?p=876</guid>
		<description><![CDATA[My website was recently migrated to a new server, and since then I haven&#8217;t been able to automatically upgrade WordPress plugins via FTP. Tonight I chased down the error. I could login via FTP from the command line, but WordPress kept telling me I had the wrong username/password. I found the error was occurring because [...]]]></description>
			<content:encoded><![CDATA[<p>My website was recently migrated to a new server, and since then I haven&#8217;t been able to automatically upgrade WordPress plugins via FTP. Tonight I chased down the error. I could login via FTP from the command line, but WordPress kept telling me I had the wrong username/password. I found the error was occurring because the PHP ftp_login() method was failing, so I wrote this test.php file:</p>
<p><code>&lt;?php<br />
$link = ftp_ssl_connect('mydomain.ca',21);<br />
if ( !$link )<br />
&nbsp;&nbsp;&nbsp;&nbsp;echo 'link failed';<br />
if ( ! ftp_login($link, 'username', 'passwd') )<br />
&nbsp;&nbsp;&nbsp;&nbsp;echo 'username/password fail';<br />
?&gt;</code></p>
<p>ftp_login() would fail and raise the following warning:<br />
<code>Warning: ftp_login(): AUTH not understood in /home/balleyne/test.php</code></p>
<p>The failure was misleading. It wasn&#8217;t a problem with the username/password, but with SSL. Changing ftp_ssl_connect() to ftp_connect() made the connection possible. (Also, I didn&#8217;t seem to be having the error in PHP4, but I only tested from one PHP4 server). Turns out the ProFTPD server wasn&#8217;t yet configured to accept TLS/SSL connections. I used <a href="http://www.howtoforge.com/proftpd-tls-debian-etch">this reference</a> to generate the keys (step 3):</p>
<p><code># mkdir /etc/proftpd/ssl<br />
# openssl req -new -x509 -days 365 -nodes -out /etc/proftpd/ssl/proftpd.cert.pem -keyout /etc/proftpd/ssl/proftpd.key.pem</code></p>
<p>The next step in that guide didn&#8217;t square up with the proftpd.conf files on my server though, but there was already a file /etc/proftpd/tls.conf which was all set to go. I just uncommented the settings, changing the file names as appropriate. Also, I changed &#8216;TLSRequired&#8217; from on to off (since I still want to allow non-TLS connections).</p>
<p>The comments in that file explained that the key can&#8217;t be readable by anyone but root, so I ran the recommended command:<br />
<code># chmod 0600 /etc/proftpd/ssl/proftpd.key.pem</code></p>
<p>Then, I noticed an &#8216;Include&#8217; directive toward the top of /etc/proftpd.conf, so I added the following line below it:<br />
<code>Include /etc/proftpd/tls.conf</code></p>
<p>Then, restart ProFTPD:<br />
<code># /etc/init.d/proftpd restart</code></p>
<p>Now, ftp_ssl_connect + ftp_login work fine in PHP5. WordPress = updated.</p>
]]></content:encoded>
			<wfw:commentRss>http://blaise.ca/blog/2009/06/02/fixed-php-warning-ftp_login-auth-not-understood/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

