<?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>Solid State Raam &#187; Windows</title>
	<atom:link href="http://solidstateraam.com/category/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://solidstateraam.com</link>
	<description>Explorations (and exploitations) of the digital world by one of its many netizens.</description>
	<lastBuildDate>Thu, 13 May 2010 19:24:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP Session Permission Denied Errors with Sub-Domains and IE7 or IE8</title>
		<link>http://solidstateraam.com/php-session-permission-denied-errors-with-sub-domains-and-ie7-or-ie8/</link>
		<comments>http://solidstateraam.com/php-session-permission-denied-errors-with-sub-domains-and-ie7-or-ie8/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 13:23:42 +0000</pubDate>
		<dc:creator>Raam</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Weird]]></category>

		<guid isPermaLink="false">http://solidstateraam.com/?p=493</guid>
		<description><![CDATA[I encountered a strange problem with IE7 and IE8 where if I visited example.com first and then visited sub-domain.example.com, Apache would return Permission Denied errors errors when trying to access the PHP session files for sub-domain.example.com. After some investigation, it appears this is a problem with the way IE7 and IE8 request session data from Apache, or possibly because IE7 and IE8 have a non-standard way of announcing the domain they're requesting session data for.]]></description>
			<content:encoded><![CDATA[<p>I encountered a strange problem with IE7 and IE8 where if I visited example.com first and then visited sub-domain.example.com, Apache would return Permission Denied errors errors when trying to access the PHP session files for sub-domain.example.com.</p>
<p>After some investigation, it appears this is a problem with the way IE7 and IE8 request session data from Apache, or possibly because IE7 and IE8 have a non-standard way of announcing the domain they&#8217;re requesting session data for.</p>
<p>Here&#8217;s my scenario:</p>
<p>I&#8217;m running Apache 1.3 with two domains, each has their own account with their own users:</p>
<pre class="brush: plain;">
    Domain: mycompany.com
    Session path: /tmp/
    Webserver user: mycompanycom

    Domain: support.mycompany.com
    Session path: /tmp/
    Webserver user: nobody
</pre>
<p>Here is what happens during a normal visit with Firefox/Safari/Chrome:</p>
<ol>
<li>I visit mycompany.com and session file is created in <code>/tmp/</code> owned by the user <code>mycompanycom</code></li>
<li>I then visit support.mycompany.com, and second session file is created in <code>/tmp/</code> owned by user <code>nobody</code></li>
<li>Apache doesn&#8217;t get confused and the correct session files are returned</li>
</ol>
<p>However, here&#8217;s what happens during a visit with IE7 and IE8:</p>
<ol>
<li>I visit mycompany.com and a session file is created in <code>/tmp/</code> owned by the user <code>mycompanycom</code></li>
<li>I then visit support.mycompany.com and, instead of creating second session file in <code>/tmp/</code> owned by the user <code>nobody</code> as you would expect (and as happens when using Firefox/Safari/Chrome), Apache tries to return the session file for mycompany.com. </li>
<li>The session file for mycompany.com is owned by the user <code>mycompanycom</code>, so the web server, running as user <code>nobody</code> cannot access it. Permission is denied.</li>
</ol>
<p>I searched Google for a solution and came across <a href="http://stackoverflow.com/questions/912098/permissions-to-php-session-files/">this question on StackOverflow</a>. Several users suggested creating a separate directory in <code>/tmp/</code> to separate the stored session data for support.mycompany.com from the session data for mycompany.com and then telling PHP to store all session data for support.mycompany.com in the new directory. This worked perfectly!</p>
<p>Here&#8217;s what I did. First, create the new session directory (Note: Make sure the new directory resides inside <code>/tmp/</code>!):</p>
<pre class="brush: bash;">
    mkdir /tmp/support.mycompany.com
    chown nobody:nobody /tmp/support.mycompany.com
</pre>
<p>I then added the following to an <code>.htaccess</code> file in the root web directory for support.mycompany.com:</p>
<pre class="brush: bash;">
    php_value session.save_path '/tmp/support.mycompany.com'
</pre>
<p>And finally, I removed all existing session data in <code>/tmp/</code> to ensure the new session path would get used immediately:</p>
<pre class="brush: bash;">
    rm -f /tmp/sess_*
</pre>
<p>And that&#8217;s it! Now IE7 and IE8 work properly because when visiting support.mycompany.com, IE7 and IE8 do not accidentally find session data for mycompany.com and try to use it.</p>
<p>I&#8217;m fairly certain this problem has to do with how IE7 and IE8 request session data from Apache. They probably first request session data for mycompany.com and THEN request session data for support.mycompany.com, even though the latter was the only doman entered in the address bar.</p>
]]></content:encoded>
			<wfw:commentRss>http://solidstateraam.com/php-session-permission-denied-errors-with-sub-domains-and-ie7-or-ie8/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Internet Explorer: Incorrect Password During Certificate Import</title>
		<link>http://solidstateraam.com/internet-explorer-incorrect-password-during-certificate-import/</link>
		<comments>http://solidstateraam.com/internet-explorer-incorrect-password-during-certificate-import/#comments</comments>
		<pubDate>Sat, 02 May 2009 03:56:47 +0000</pubDate>
		<dc:creator>Raam</dc:creator>
				<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://solidstateraam.com/?p=165</guid>
		<description><![CDATA[While importing a P12 certificate into Internet Explorer today, I got a message saying &#8220;The password you entered is incorrect.&#8221;:

However, I successfully imported this same certificate, using the same password, on Firefox and Safari. But Internet Explorer (both IE7 and IE8) continued to tell me I was using the wrong password. After checking, double-checking, and [...]]]></description>
			<content:encoded><![CDATA[<p>While importing a P12 certificate into Internet Explorer today, I got a message saying &#8220;The password you entered is incorrect.&#8221;:</p>
<p><img src="http://solidstateraam.com/wp-content/uploads/2009/05/ie_incorrect_certificate_password.png" alt="Internet Explorer - Incorrect certificate password" /></p>
<p>However, I successfully imported this same certificate, using the same password, on Firefox and Safari. But Internet Explorer (both IE7 and IE8) continued to tell me I was using the wrong password. After checking, double-checking, and quadruple-checking the password, I was 1000% sure the private key password that I was using was correct and that Internet Explorer itself was to blame.</p>
<p>After much trial and error, I discovered the problem: <strong>Internet Explorer has a maximum private key password length!</strong> The password I was using (modified for security purposes, but identical in length) was as follows:</p>
<blockquote><p><code>603979ba15c2097f8f7fy35ec0ucfbeb</code></p></blockquote>
<p>That&#8217;s 32 characters, the same length as an MD5. However, Internet Explorer appears to have a problem with that! I changed the password to the following 26 character password and the certificate imported with no complaints from IE!</p>
<blockquote><p><code>ae869d263e267593286188b638</code></p></blockquote>
<p>If you&#8217;re having the same problem, you may be wondering how to change the password on your P12 file. To do this, you&#8217;ll need access to OpenSSL. If you have a Mac, you might be able to find OpenSSL in <code>/opt/local/bin/openssl</code>. But more likely you&#8217;re on Windows and you will need to download and install the <a href="http://www.openssl.org/related/binaries.html">OpenSSL binary for Windows</a>. </p>
<p>You can use the OpenSSL program to convert the P12 file to PEM format, and then convert the PEM certificate back into a P12 file, using a shorter 26-character password when prompted. Here&#8217;s how:</p>
<p>First, convert the original P12 file to PEM format:</p>
<pre class="brush: bash;">
openssl pkcs12 -in my-original.p12 -out certkey.pem -nodes -clcerts
</pre>
<p>This should give you a file called <code>certkey.pem</code>. This file contains both the certificate and the private key. However, the next command requires that the key be contained in a separate <code>key.pem</code> file, so you&#8217;ll want to edit <code>certkey.pem</code> with a text editor and extract the private key portion (it should be the bottom half of the file). The <code>key.pem</code> file should look somewhat like this:</p>
<pre class="brush: bash;">
Bag Attributes
    localKeyID: EE 35 CB 41 81 23 4C 89 FF 43 42 E0 3C 3B FF 93 9E 0E B7 AA
Key Attributes: &lt;No Attributes&gt;
-----BEGIN RSA PRIVATE KEY-----
MIIoOwLBAAJBANSdWgmhySZsCD/koC6nST/JzH/Uqjm6NXsQwtTwx493rhM/90BB
JyfdkfDQCHR/XP0szI1LqS/AXfSx1q25/3MCAwEAAQJBAM0Iu+Mm7zJTT7nqDgfv
VW+4RaRVp05JHaWQdeerpBnWJI+2NDsiKrovyrvYjglJcdpXHhoM95T5qm8x65XP
MhkCIQD5vQ2dNGoFGn0yL0ELDU39PrVvfZyJV3wXedjrQm9utwIhAN0FRk/qIWzz
p9ZP9DjIpIRj6BdWLRrZmLqxdnUXifSlAiBy6fb1u0RJjK7HBM9dPK7+NHiQEJCS
8dp7wZl5d1xnCSIhANLoF6pmnyLil4QwgVlOTv9ufqjSZ+w5GD7a3Vj678RpAiAV
6rTJ3mAZAeQiaRHhgRP7SuvQS6EDWDPxbMBMwYklfA==
-----END RSA PRIVATE KEY-----
</pre>
<p>With these files in place, you can run the following command to convert the PEM certificate back into a P12 format, providing a new password (maximum 26 characters) when prompted for the Export Password:</p>
<pre class="brush: bash;">
$ openssl pkcs12 -export -in certkey.pem -inkey key.pem -out my-new-certificate.p12 -rand /dev/random
2048 semi-random bytes loaded
Enter Export Password:
Verifying - Enter Export Password:
</pre>
<p>That&#8217;s it! Now you should be able to install the certificate in Internet Explorer without any &#8220;incorrect password&#8221; complaints.</p>
]]></content:encoded>
			<wfw:commentRss>http://solidstateraam.com/internet-explorer-incorrect-password-during-certificate-import/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
