<?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/"
	>

<channel>
	<title>curl &#8211; Luxing Huang</title>
	<atom:link href="https://luxing.im/tag/curl/feed/" rel="self" type="application/rss+xml" />
	<link>https://luxing.im</link>
	<description>Thoughs and things</description>
	<lastBuildDate>Sun, 12 Jun 2016 02:04:32 +0000</lastBuildDate>
	<language>en-CA</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
<site xmlns="com-wordpress:feed-additions:1">58771605</site>	<item>
		<title>cURL support for CloudFlare-enabled websites</title>
		<link>https://luxing.im/curl-support-for-cloudflare-enabled-websites/</link>
					<comments>https://luxing.im/curl-support-for-cloudflare-enabled-websites/#respond</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Mon, 06 Apr 2015 12:05:22 +0000</pubDate>
				<category><![CDATA[Techie Stuff]]></category>
		<category><![CDATA[cipher]]></category>
		<category><![CDATA[cloudflare]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[ssl]]></category>
		<guid isPermaLink="false">https://luxing.im/?p=478</guid>

					<description><![CDATA[CloudFlare provides a nice protection from DDoS and other hacking activities, last year they even added a free UniverSSL package to all users. The problem began with the cURL ciphers on cloudflare-enabled websites. cURL does not successfully handshake with cloudflare servers with its default encryption algorithms. Update: Recent update on cURL and nss libs have &#8230; <p class="link-more"><a href="https://luxing.im/curl-support-for-cloudflare-enabled-websites/" class="more-link">Continue reading<span class="screen-reader-text"> "cURL support for CloudFlare-enabled websites"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>CloudFlare provides a nice protection from DDoS and other hacking activities, last year they even added a free UniverSSL package to all users. The problem began with the cURL ciphers on cloudflare-enabled websites. cURL does not successfully handshake with cloudflare servers with its default encryption algorithms.</p>
<p><strong>Update: Recent update on cURL and nss libs have enabled curl to operate on CloudFlare-enabled web pages without doing anything. Git also works now.</strong></p>
<p><span id="more-478"></span></p>
<p>I test my website out using openssl s_client.</p>
<pre>openssl s_client -connect luxing.im:443</pre>
<p>We could see the following output:<br />
<code><br />
...<br />
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256<br />
Server public key is 2048 bit<br />
Secure Renegotiation IS supported<br />
Compression: NONE<br />
Expansion: NONE<br />
SSL-Session:<br />
    Protocol  : TLSv1.2<br />
    Cipher    : ECDHE-RSA-AES128-GCM-SHA256<br />
...<br />
</code></p>
<p>OK so it is using ECDHE-RSA-AES128-GCM-SHA256 cipher to connect to my website.</p>
<p>Well, let&#8217;s try this:</p>
<pre>curl https://luxing.im --cipher ecdhe_rsa_aes_128_gcm_sha_256</pre>
<p>curl: (35) Cannot communicate securely with peer: no common encryption algorithm(s).</p>
<p>Huh. Strange isn&#8217;t it? With a LOT of searching, finally I got an answer from <a href="http://comments.gmane.org/gmane.comp.web.curl.general/14446" target="_blank">here</a>, I added the suggested line to .curlrc in my home directory:</p>
<pre>
 ciphers="rsa_aes_256_sha,rsa_aes_128_sha,dhe_rsa_aes_256_cbc_sha,dhe_rsa_aes_128_cbc_sha,rsa_aes_256_cbc_sha_256,rsa_aes_128_cbc_sha_256,dhe_rsa_aes_256_cbc_sha_256,dhe_rsa_aes_128_cbc_sha_256,rsa_aes_128_gcm_sha_256,ecdhe_rsa_aes_128_gcm_sha_256,ecdhe_ecdsa_aes_128_gcm_sha_256"</pre>
<p>Then try:</p>
<pre>curl -v https://luxing.im</pre>
<p>Yes, now my curl is working. Let&#8217;s see the output:<br />
<code><br />
...<br />
* SSL connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256<br />
...<br />
</code></p>
<p>OK. It is actually using the TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 algorithm, so forcing the cipher to use ecdhe_ecdsa_aes_128_gcm_sha_256 works.</p>
<p>My curl is:<br />
<code><br />
curl -V<br />
curl 7.37.0 (x86_64-redhat-linux-gnu) libcurl/7.37.0 NSS/3.17.4 Basic ECC zlib/1.2.8 libidn/1.28 libssh2/1.4.3<br />
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp<br />
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz Metalink<br />
</code><br />
And I am on Fedora 20+.</p>
<p>Note:<br />
1. Debian/RHEL/CentOS series does not support this algorithm. You&#8217;ll have to create a ticket to CloudFlare support to discuss it with them.<br />
2. According to <a href="http://stackoverflow.com/questions/13114268/passing-ciphers-to-libcurl-through-git" target="_blank">this</a>, git uses cURL to access https repositories but this workaround won&#8217;t help. Too bad.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/curl-support-for-cloudflare-enabled-websites/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">478</post-id>	</item>
	</channel>
</rss>
