<?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>Institutional Knowledge &#187; LDAP</title>
	<atom:link href="http://blogs.csuchico.edu/ik/category/ldap/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.csuchico.edu/ik</link>
	<description>Wherein we write down some stuff that we know.</description>
	<lastBuildDate>Mon, 24 Aug 2009 16:28:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9-rare</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HOWTO: Fix Broken RHEL 4 and Perl LDAPS Connections</title>
		<link>http://blogs.csuchico.edu/ik/2008/09/18/perl-ldaps/</link>
		<comments>http://blogs.csuchico.edu/ik/2008/09/18/perl-ldaps/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 15:06:25 +0000</pubDate>
		<dc:creator>pberry</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[perl ldaps rhel]]></category>

		<guid isPermaLink="false">http://blogs.csuchico.edu/ik/?p=386</guid>
		<description><![CDATA[Wherein we fix broken LDAPS connection in RHEL 4 perl.]]></description>
			<content:encoded><![CDATA[<p>Are your <span class="caps">LDAPS </span>connections from perl scripts suddenly broken and you&#8217;re stuck staring at a screen with a seemingly useless error message?</p>

<blockquote><p>is only avaliable [sic] with the XS version at /usr/lib/perl5/site_perl/5.8.5/IO/Socket/SSL.pm, line 30</p></blockquote>

<p>I say seemingly because you know <em>you</em> didn&#8217;t change anything about IO::Socket::SSL.  A few Google searches will at least fill in the blank before the is and tell you that <span class="caps">LDAPS </span>is unhappy.</p>

<p>If you are running <span class="caps">RHEL</span> 4, you probably had to install IO::Socket::SSL from <span class="caps">CPAN. </span> RedHat updated Perl 5.8.5 and some modules that required the XS (interface to use compiled C libraries in modules) version of Scalar::List::Utils.  I&#8217;m not sure exactly what broke, but the <em>easiest fix</em> is to update IO::Socket::SSL from <span class="caps">CPAN </span>and it will update Scalar::List::Utils and all will be well.</p>]]></content:encoded>
			<wfw:commentRss>http://blogs.csuchico.edu/ik/2008/09/18/perl-ldaps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CASLogin Plugin</title>
		<link>http://blogs.csuchico.edu/ik/2006/07/10/caslogin-plugin/</link>
		<comments>http://blogs.csuchico.edu/ik/2006/07/10/caslogin-plugin/#comments</comments>
		<pubDate>Mon, 10 Jul 2006 17:41:00 +0000</pubDate>
		<dc:creator>sjungling</dc:creator>
				<category><![CDATA[Authentication]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blogs.csuchico.edu/ik/2006/07/10/caslogin-plugin/</guid>
		<description><![CDATA[Wherein we develop a CAS plugin for Rails.]]></description>
			<content:encoded><![CDATA[<p>In an effort to further <span>abstract</span> the <span class="caps">CAS</span> Login portion of our Ruby on Rails applications, I&#8217;ve taken our <span class="caps">CAS</span> Login Module and turned that into a plugin that can be included in any past or present Rails applications and managed separate from the development of the applications themselves. You can read all about how the plugin works and how to use it in your application on the <a href="http://developer.csuchico.edu/wiki/ruby_on_rails:caslogin_plugin">Developer Wiki</a>. </p>

<p>This also marks the beginning of our public <a href="http://developer.csuchico.edu/svn">Subversion repository</a> allowing other developers to access our code via <span class="caps">SVN.</span> Currently, the <span class="caps">CASL</span>ogin plugin is the only source available and only Web Services has write permissions to the repository.</p>

<p><strong>Links</strong></p>

<ul>
<li><a href="http://developer.csuchico.edu/wiki/ruby_on_rails:caslogin_plugin">http://developer.csuchico.edu/wiki/ruby_on_rails:caslogin_plugin</a></li>
<li><a href="http://developer.csuhico.edu/svn">http://developer.csuhico.edu/svn</a></li>
</ul>
<!-- technorati tags begin --><p style="font-size:10px;text-align:right;">technorati tags:<a href="http://technorati.com/tag/cas" rel="tag">cas</a>, <a href="http://technorati.com/tag/wiki" rel="tag">wiki</a>, <a href="http://technorati.com/tag/plugin" rel="tag">plugin</a>, <a href="http://technorati.com/tag/rubyonrails" rel="tag">rubyonrails</a></p><!-- technorati tags end -->]]></content:encoded>
			<wfw:commentRss>http://blogs.csuchico.edu/ik/2006/07/10/caslogin-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: &#8220;Fix&#8221; Secure LDAP in PHP</title>
		<link>http://blogs.csuchico.edu/ik/2006/02/18/howto-fix-secure-ldap-in-php/</link>
		<comments>http://blogs.csuchico.edu/ik/2006/02/18/howto-fix-secure-ldap-in-php/#comments</comments>
		<pubDate>Sat, 18 Feb 2006 22:32:46 +0000</pubDate>
		<dc:creator>pberry</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[LDAP]]></category>

		<guid isPermaLink="false">http://fozzy.csuchico.edu/wordpress/2006/02/18/howto-fix-secure-ldap-in-php/</guid>
		<description><![CDATA[Wherein we slay openssl, php, and ldap dragons.]]></description>
			<content:encoded><![CDATA[
<p><em>Preface:</em> I am not an expert in encryption, SSL, or LDAP.  Your install may be functioning just fine and you don&#8217;t need any of this information.  You use this <strong>at your own risk</strong> as it may be <em>completely wrong</em>.  That being said, it worked for me.</p>

<p>Making a secure (ldaps) connection in PHP (php-4.3.9-3.8) on Red Hat Enterprise Linux AS release 4 (Nahant Update 1) will fail if on ldap_connect (&#8220;Error -1: Can&#8217;t connect to LDAP server&#8221;) if the certificate cannot be verified.  Due to the release of a new intermediate certificate from Verisign, it is likely that your install of openssl will not have access to that intermediate cert.  Thus openssl will tell you that there is a self-signed certificate in the chain (&#8220;Error -19&#8221;).  If you recently bought a certificate from Verisign you will not find much in the way of help for dealing with LDAP, PHP, or openssl.</p>

<p>The answer with web servers is generally well documented, and the intermediate certificate is made available to the server to send to the client.  This is good because it means that 8 trillion web browsers don&#8217;t generally need to be updated to use SSL.</p>

<p>It should also be noted that it is probably best to &#8220;fix&#8221; this issue at the server level rather than the client because each and every client would need to be fixed as opposed to just fixing the server once.  If you do not have access to the server to fix it, this should work for you.</p>

<ol>
<li><p>Obtain a copy of the <a href="http://www.verisign.com/support/install/intermediate.html">Verisign intermediate certificate</a>.
Save it as a text file on a system where you can run openssl binaries.</p></li>
<li><p><a href="http://www.cementhorizon.com/wiki/index.php/Convert_PEM_Certificate_to_ca-bundle.crt_format">Convert from PEM to ca-bundle format</a> (*Update:* There is a updated script for BSD sed if you are on OS X).  Save this output as you may need to do the next few steps on multiple servers.</p>

<div class="igBar"><span id="lcode-1"><a href="#" onclick="javascript:showCodeTxt('code-1'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">CODE:</span><br /><div id="code-1">
<div class="code"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#!/bin/sh</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># Friendly Name</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">openssl x509 -in $<span style="color:#800000;color:#800000;">1</span> -text -noout | \</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sed -n -e <span style="color:#CC0000;">&#8217;/^[ ]<span style="color:#000099; font-weight:bold;">\+</span>Subject:/{s/^.*CN=<span style="color:#000099; font-weight:bold;">\(</span>[^,]*<span style="color:#000099; font-weight:bold;">\)</span>.*/<span style="color:#000099; font-weight:bold;">\1</span>/;p}&#8217;</span> </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># Underline Friendly Name with equal signs</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">openssl x509 -in $<span style="color:#800000;color:#800000;">1</span> -text -noout | \</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sed -n -e <span style="color:#CC0000;">&#8217;/^[ ]<span style="color:#000099; font-weight:bold;">\+</span>Subject:/{s/^.*CN=<span style="color:#000099; font-weight:bold;">\(</span>[^,]*<span style="color:#000099; font-weight:bold;">\)</span>.*/<span style="color:#000099; font-weight:bold;">\1</span>/;p}&#8217;</span> | \</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sed -e <span style="color:#CC0000;">&#8217;s/./=/g&#8217;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># Output Fingerprint and swap = for :</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">openssl x509 -in $<span style="color:#800000;color:#800000;">1</span> -noout -fingerprint | sed -e <span style="color:#CC0000;">&#8217;s/=/: /&#8217;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># Output PEM Data:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo <span style="color:#CC0000;">&#8216;PEM Data:&#8217;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># Output Certificate</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">openssl x509 -in $<span style="color:#800000;color:#800000;">1</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># Output Cettificate text swapping Certificate with Certificate Ingredients</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">openssl x509 -in $<span style="color:#800000;color:#800000;">1</span> -text -noout | sed -e <span style="color:#CC0000;">&#8217;s/^Certificate:/Certificate Ingredients:/&#8217;</span> </div></li></ol></div>
</div></div><br />
</li>
<li><p>Locate and backup your ca-bundle.crt</p>

<p><code>locate ca-bundle.crt</code> should show you where on your system this file lives.  On RHEL <code>/usr/share/ssl/cert.pem</code> is also symlinked to your ca-bundle.crt.</p></li>
<li><p>Append the converted intermediate certificate to your ca-bundle.crt file.</p>

<p>You can now test using the openssl command:</p>

<p><code>openssl s_client -host your.ldap.edu -port 636 -CAfile /usr/share/ssl/certs/ca-bundle.crt</code>.</p>

<p>A <code>Verify return code: 0 (ok)</code> is what you are looking for.</p></li>
<li><p>Configure OpenLDAP on the system that PHP is running on to use your ca-bundle.crt.</p>

<p>Locate your ldap.conf for OpenLDAP.  On RHEL it is <code>/etc/openldap/ldap.conf</code>.</p>

<p>Add the following: <code>TLS_CACERT /usr/share/ssl/cert.pem</code> (which on RHEL is a symlink to ca-bundle.crt).  Thanks to <a href="https://rulink.rutgers.edu/loadca.html">Rutgers</a> for this tidbit.</p></li>
<li><p>Restart httpd.</p></li>
</ol>

<p>PHP should now successfully connect <em>securely</em> to your LDAP server.</p>

<h3 id="errata">Errata</h3>

<p><em>Added restart of httpd (2005-09-10 11:52:00)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.csuchico.edu/ik/2006/02/18/howto-fix-secure-ldap-in-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Happy LDAP</title>
		<link>http://blogs.csuchico.edu/ik/2005/12/05/happy-ldap/</link>
		<comments>http://blogs.csuchico.edu/ik/2005/12/05/happy-ldap/#comments</comments>
		<pubDate>Mon, 05 Dec 2005 19:31:44 +0000</pubDate>
		<dc:creator>pberry</dc:creator>
				<category><![CDATA[Authentication]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Portal]]></category>

		<guid isPermaLink="false">http://fozzy.csuchico.edu/wordpress/?p=29</guid>
		<description><![CDATA[Where in we discover highly available LDAP.]]></description>
			<content:encoded><![CDATA[<p>We now have our <span class="caps">LDAP </span>servers running behind a virtual host maintained by a Cisco Systems content switch.  This is a very good thing as it should allow us to do <span class="caps">LDAP </span>maintenance in the future with minimal to no interruptions.  Secure, redundant, fail-over&#8230;ahhhh, how sweet it is.</p>]]></content:encoded>
			<wfw:commentRss>http://blogs.csuchico.edu/ik/2005/12/05/happy-ldap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
