<?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>setup &#8211; Luxing Huang</title>
	<atom:link href="https://luxing.im/tag/setup/feed/" rel="self" type="application/rss+xml" />
	<link>https://luxing.im</link>
	<description>Thoughs and things</description>
	<lastBuildDate>Sun, 21 Feb 2016 05:04:14 +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>Enabling gpg-agent</title>
		<link>https://luxing.im/enabling-gpg-agent/</link>
					<comments>https://luxing.im/enabling-gpg-agent/#respond</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Sun, 21 Feb 2016 05:02:14 +0000</pubDate>
				<category><![CDATA[Techie Stuff]]></category>
		<category><![CDATA[agent]]></category>
		<category><![CDATA[daemon]]></category>
		<category><![CDATA[gnupg]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[setup]]></category>
		<guid isPermaLink="false">https://luxing.im/?p=614</guid>

					<description><![CDATA[When I was following this tutorial to setup GnuPG for mutt account profiles on my personal laptop, I hit gpg-agent is not available in this session error when I was trying to decrypt my profile. Also, I have to type my password for every time when I try decryption. This is annoying. With a little &#8230; <p class="link-more"><a href="https://luxing.im/enabling-gpg-agent/" class="more-link">Continue reading<span class="screen-reader-text"> "Enabling gpg-agent"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>When I was following <a href="http://xmodulo.com/mutt-email-client-encrypted-passwords.html" target="_blank">this</a> tutorial to setup GnuPG for mutt account profiles on my personal laptop, I hit <code>gpg-agent is not available in this session</code> error when I was trying to decrypt my profile. Also, I have to type my password for every time when I try decryption.</p>
<p>This is annoying.<br />
<span id="more-614"></span></p>
<p>With a little poking around, I found 2 reasons that could affect my setup. First, the gpg-agent.conf under ~/.gnupg. My current setup is:</p>
<pre>
default-cache-ttl 999999
max-cache-ttl 999999
ignore-cache-for-signing
</pre>
<p>Obviously I maxed-out the expiration time gpg-agent stores my password in cache (the default-cache-ttl value. It used to be 0).</p>
<p>Secondly, I installed gnupg2 long time ago and I was using gpg-agent for GnuPG 2, the gpg command is actually from GnuPG 1. This confused me a little to figure out. Make sure to use <code>gpg2</code> command rather than <code>gpg</code>.</p>
<p>If you are encrypting mutt profile too, make sure to use <code>gpg2</code> everywhere.</p>
<p>Finally, run this at boot time to start an agent daemon.</p>
<pre>gpg-agent --daemon --allow-preset-passphrase</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/enabling-gpg-agent/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">614</post-id>	</item>
		<item>
		<title>SSL Setup</title>
		<link>https://luxing.im/ssl-setup/</link>
					<comments>https://luxing.im/ssl-setup/#respond</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Mon, 28 Jul 2014 18:14:19 +0000</pubDate>
				<category><![CDATA[Learning Notes]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[ssl]]></category>
		<guid isPermaLink="false">http://blog.luxing.im/?p=404</guid>

					<description><![CDATA[This is a personal technical note for SSL certificate setup, ensuring better scores at SSL Labs so that we have a better Internet security for our own. I use the built-in script provided from RHEL/CentOS to generate a private key. The location is under /etc/ssl/cert, by typing make site.key It will generate a private key. &#8230; <p class="link-more"><a href="https://luxing.im/ssl-setup/" class="more-link">Continue reading<span class="screen-reader-text"> "SSL Setup"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>This is a personal technical note for SSL certificate setup, ensuring better scores at <a href="https://www.ssllabs.com" target="_blank">SSL Labs</a> so that we have a better Internet security for our own.</p>
<p><span id="more-404"></span></p>
<p>I use the built-in script provided from RHEL/CentOS to generate a private key. The location is under <em>/etc/ssl/cert</em>, by typing</p>
<pre>make site.key</pre>
<p>It will generate a private key. Its actual command is:</p>
<pre>openssl genrsa -aes128 2048 </pre>
<p>You can adjust the key size for your own needs, but at least 2048 is needed for a relatively secure certificate.</p>
<p>Then we make its CSR by typing:</p>
<pre>make site.csr</pre>
<p>The actual command is:</p>
<pre>openssl req -new -key site.key -out site.csr -aes256</pre>
<p>The name <strong>site</strong> must be the same as the key name for the script to work. You can now copy and paste the CSR to whoever your trusted SSL Certificate Provider to sign. It doesn&#8217;t matter who choose to sign it as long as your user and you trust it, therefore I used <a href="https://www.CACert.org" target="_blank">CACert.org</a></p>
<p>Before we do anything else, we need to generate a different DH param. Let&#8217;s cd into /etc/nginx/ssl (or whatever you prefer), and do the following command:</p>
<pre>openssl dhparam -out dhparams.pem 2048</pre>
<p>Now we generate a custom DH param for securer DH. In the configuration next, we will use it.</p>
<p>Next, we need to setup a website that runs on SSL. Choosing the cipher is the most important part that prevents most of the crackers cracking decipher your server&#8217;s communication. The httpd side of software I choose is nginx, I like its versatility and efficiency.</p>
<p>Inside the server block, we must have the following lines:</p>
<pre>
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256: DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA";
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:50m;
ssl_session_timeout 5m;

ssl_dhparam /etc/nginx/ssl/dhparams.pem;

add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; # includeSubdomains only needed for the whole site encryption. You may or may not need it.

# The following settings only works with CA certified certs, not self-signed certs.
ssl_stapling on; 
resolver 8.8.8.8;
ssl_trusted_certificate /etc/nginx/ssl/root.crt; # Your CA Root cert.
</pre>
<p>The main purpose of Line 1 is to stop accepting requests from insecure protocols such as SSLv2, Line 2 restricts the cipher we will be using, and stop some insecure ciphers such as MD5 and RC4. If we add RC4 back on the list, we eliminate the chance to get BEAST attack, but will suffer RC4 attack. By removing RC4, some of the older browsers will not support visiting the website and possible to suffer BEAST attack. The future trend is, RC4 attack will get more sophisticated, and chance of BEAST attack will get smaller, I&#8217;d recommend to remove RC4 from the list.</p>
<p>Line 4 and 5 are for the SSL reuse, this can improve the performance. Line 6, 7, 8 are related to OCSP stapling, it enables the server to check the OCSP status, which can check the revocation of the certificates. The root.crt is the Class 1 PKI key of your CA.</p>
<p>Go to SSLLabs for a test, you might get an A+ if your signing authority is trusted!</p>
<p>Read more:<br />
<a href="http://crypto.stackexchange.com/questions/8933/how-can-i-use-ssl-tls-with-perfect-forward-secrecy" target="_blank">http://crypto.stackexchange.com/questions/8933/how-can-i-use-ssl-tls-with-perfect-forward-secrecy</a><br />
<a href="https://community.qualys.com/blogs/securitylabs/2013/08/05/configuring-apache-nginx-and-openssl-for-forward-secrecy" target="_blank">https://community.qualys.com/blogs/securitylabs/2013/08/05/configuring-apache-nginx-and-openssl-for-forward-secrecy</a><br />
<a href="http://googleonlinesecurity.blogspot.co.uk/2014/08/https-as-ranking-signal_6.html" target="_blank">http://googleonlinesecurity.blogspot.co.uk/2014/08/https-as-ranking-signal_6.html</a><br />
<a href="https://istlsfastyet.com/?utm_source=wmx_blog&#038;utm_medium=referral&#038;utm_campaign=tls_en_post" target="_blank">https://istlsfastyet.com/?utm_source=wmx_blog&#038;utm_medium=referral&#038;utm_campaign=tls_en_post</a><br />
<a href="http://chimera.labs.oreilly.com/books/1230000000545/ch04.html#TLS_RECORD_SIZE" target="_blank">http://chimera.labs.oreilly.com/books/1230000000545/ch04.html#TLS_RECORD_SIZE</a><br />
<a href="https://gist.github.com/plentz/6737338" target="_blank">https://gist.github.com/plentz/6737338</a><br />
<a href="http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_trusted_certificate" target="_blank">http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_trusted_certificate</a><br />
<a href="http://nginx.com/blog/nginx-poodle-ssl/" target="_blank">http://nginx.com/blog/nginx-poodle-ssl/</a><br />
<a href="https://weakdh.org/sysadmin.html" target="_blank">https://weakdh.org/sysadmin.html</a></p>
<p>Changelog:<br />
2014.08.13 &#8211; Added 3DES back to cipher suites for Windows XP compability.<br />
2014.10.17 &#8211; SSLv3 support is removed (POODLE). Strict Transport Security is added.<br />
2015.03.03 &#8211; RC4 removed and banned.<br />
2015.06.02 &#8211; Update DH strength</p>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/ssl-setup/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">404</post-id>	</item>
	</channel>
</rss>
