<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Apache SSL in htaccess examples</title>
	<atom:link href="http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html</link>
	<description>Advanced Web Development</description>
	<lastBuildDate>Wed, 18 Nov 2009 23:28:48 -0500</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jeff</title>
		<link>http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-104556</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Sun, 27 Sep 2009 00:29:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-104556</guid>
		<description>&lt;pre&gt;SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq &quot;google.com&quot;
ErrorDocument 403 https://google.com&lt;/pre&gt;

Thanks! This works great but I want to use this for a folder that is shared by every vhost. It&#039;s actually my awstats directory. If I access awstats via any of my websites (e.g, &lt;code&gt;/awstats&lt;/code&gt;), I get the stats for that paticular website. The server was preconfigured so I guess there is a rewrite rule somewhere in one of the many config files.

Line &lt;code&gt;SSLRequire %{HTTP_HOST} eq &quot;google.com&quot;&lt;/code&gt; only lists one host name (google.com). Is there a way to set this up so SSL is required no matter the host name?
</description>
		<content:encoded><![CDATA[<pre>SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "google.com"
ErrorDocument 403 https://google.com</pre>
<p>Thanks! This works great but I want to use this for a folder that is shared by every vhost. It&#8217;s actually my awstats directory. If I access awstats via any of my websites (e.g, <code>/awstats</code>), I get the stats for that paticular website. The server was preconfigured so I guess there is a rewrite rule somewhere in one of the many config files.</p>
<p>Line <code>SSLRequire %{HTTP_HOST} eq "google.com"</code> only lists one host name (google.com). Is there a way to set this up so SSL is required no matter the host name?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajay</title>
		<link>http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-79144</link>
		<dc:creator>Ajay</dc:creator>
		<pubDate>Thu, 04 Jun 2009 14:13:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-79144</guid>
		<description>Hi,
We are using Apache 2 for secure mode and using &lt;code&gt;MOD jk&lt;/code&gt; to redirect our request to tomcat 6.0.
We are using client certificate created with ca-authority application. We have following entries in our &lt;code&gt;ssl.conf&lt;/code&gt; like...
&lt;pre&gt;DocumentRoot &quot;/var/apache2/htdocs&quot;
ServerName sun1111.abc.com:443
ServerAdmin Ab@abc.com
LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot;
ErrorLog logs/myprodcheck_error_log
TransferLog logs/myprodcheck_access_log
&#160;
AddType text/html .asp
&#160;
#   SSL Engine Switch:
SSLEngine on
&#160;
#   SSL Cipher Suite:
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
&#160;
#   Server Certificate:
SSLCertificateFile /var/apache2/conf/ssl.crt/abc.crt
&#160;
#   Server Private Key:
SSLCertificateKeyFile /var/apache2/conf/ssl.key/abc.key
&#160;
#   Server Certificate Chain:
#SSLCertificateChainFile /var/apache2/conf/ssl.crt/ca.crt
&#160;
#   Certificate Authority (CA):
SSLCACertificateFile /var/apache2/conf/ssl.crt/ca-bundle.crt
&#160;
#   Client Authentication (Type):
SSLVerifyClient optional
SSLVerifyDepth  3
&#160;
#   Access Control:
#
#SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP&#124;NULL)/ \
#            and %{SSL_CLIENT_S_DN_O} eq &quot;Snake Oil, Ltd.&quot; \
#            and %{SSL_CLIENT_S_DN_OU} in {&quot;Staff&quot;, &quot;CA&quot;, &quot;Dev&quot;} \
#            and %{TIME_WDAY} &gt;= 1 and %{TIME_WDAY} = 8 and %{TIME_HOUR} &lt;= 20       ) \
#           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
#
SSLOptions +StdEnvVars
&#160;
#   SSL Engine Options:
#SSLOptions +FakeBasicAuth +ExportCertData +CompatEnvVars +StrictRequire
SSLOptions +StdEnvVars&lt;/pre&gt;


And it&#039;s working fine and it&#039;s showing the server certification when we&#039;ll access our site with &lt;code&gt;HTTPS&lt;/code&gt;. 
But issue is that now we need the values from client certificate from client machine. So how we can read these variable from request with java api.


Thanks in advanced,
Ajay</description>
		<content:encoded><![CDATA[<p>Hi,<br />
We are using Apache 2 for secure mode and using <code>MOD jk</code> to redirect our request to tomcat 6.0.<br />
We are using client certificate created with ca-authority application. We have following entries in our <code>ssl.conf</code> like&#8230;</p>
<pre>DocumentRoot "/var/apache2/htdocs"
ServerName sun1111.abc.com:443
ServerAdmin Ab@abc.com
LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\""
ErrorLog logs/myprodcheck_error_log
TransferLog logs/myprodcheck_access_log
&nbsp;
AddType text/html .asp
&nbsp;
#   SSL Engine Switch:
SSLEngine on
&nbsp;
#   SSL Cipher Suite:
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
&nbsp;
#   Server Certificate:
SSLCertificateFile /var/apache2/conf/ssl.crt/abc.crt
&nbsp;
#   Server Private Key:
SSLCertificateKeyFile /var/apache2/conf/ssl.key/abc.key
&nbsp;
#   Server Certificate Chain:
#SSLCertificateChainFile /var/apache2/conf/ssl.crt/ca.crt
&nbsp;
#   Certificate Authority (CA):
SSLCACertificateFile /var/apache2/conf/ssl.crt/ca-bundle.crt
&nbsp;
#   Client Authentication (Type):
SSLVerifyClient optional
SSLVerifyDepth  3
&nbsp;
#   Access Control:
#
#SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
#            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
#            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
#            and %{TIME_WDAY} &gt;= 1 and %{TIME_WDAY} = 8 and %{TIME_HOUR} &lt;= 20       ) \
#           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
#
SSLOptions +StdEnvVars
&nbsp;
#   SSL Engine Options:
#SSLOptions +FakeBasicAuth +ExportCertData +CompatEnvVars +StrictRequire
SSLOptions +StdEnvVars</pre>
<p>And it&#8217;s working fine and it&#8217;s showing the server certification when we&#8217;ll access our site with <code>HTTPS</code>.<br />
But issue is that now we need the values from client certificate from client machine. So how we can read these variable from request with java api.</p>
<p>Thanks in advanced,<br />
Ajay</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-58352</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Thu, 22 Jan 2009 20:28:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-58352</guid>
		<description>Very comprehensive. Thank you.</description>
		<content:encoded><![CDATA[<p>Very comprehensive. Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john</title>
		<link>http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-47639</link>
		<dc:creator>john</dc:creator>
		<pubDate>Wed, 03 Dec 2008 15:54:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-47639</guid>
		<description>Wow! This is the best site on Apache redirects and rewrites on the Internet! I have looked &lt;em&gt;everywhere&lt;/em&gt;

I just have a quick question.. you know when a request is made to a secure area, and for that directory there is a SSLRequire directive. If the user has the digital certificate installed it&#039;s all fine. However, if they don&#039;t have the certificate installed you get a big Apache error:

(Error code: ssl_error_handshake_failure_alert)

Is it possible to do a rewrite so that if they don&#039;t have the certificate installed it redirects them to a page informing them of this?

/John</description>
		<content:encoded><![CDATA[<p>Wow! This is the best site on Apache redirects and rewrites on the Internet! I have looked <em>everywhere</em></p>
<p>I just have a quick question.. you know when a request is made to a secure area, and for that directory there is a SSLRequire directive. If the user has the digital certificate installed it&#8217;s all fine. However, if they don&#8217;t have the certificate installed you get a big Apache error:</p>
<p>(Error code: ssl_error_handshake_failure_alert)</p>
<p>Is it possible to do a rewrite so that if they don&#8217;t have the certificate installed it redirects them to a page informing them of this?</p>
<p>/John</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AskApache</title>
		<link>http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-47292</link>
		<dc:creator>AskApache</dc:creator>
		<pubDate>Mon, 17 Nov 2008 20:52:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-47292</guid>
		<description>&lt;p&gt;Two possible scenarios for X509 authentication follow:&lt;/p&gt;
&lt;p&gt;A fairly strict authentication setup for one or two administrators&lt;/p&gt;
&lt;pre&gt;
&lt;Directory [absolute path to directory for service, in quotes]&gt;
SSLOptions  +StdEnvVars +ExportCertData +FakeBasicAuth +OptRenegotiate +CompatEnvVars
SSLVerifyClient   require
SSLVerifyDepth    5
SSLRequireSSL
SSLRequire %{SSL_CLIENT_I_DN_CN} eq &quot;the CN of the Issuer DN of client&#039;s certificate in quotes&quot;  
and %{SSL_CLIENT_S_DN_O} eq &quot;the O of the Subject DN in client&#039;s certificate in quotes&quot;  
and %{SSL_CLIENT_S_DN_CN} in {&quot;the CN of one or more&quot;, &quot;comma delimited Subject DNs in quotes&quot;}
&lt;/Directory&gt;
&lt;/pre&gt;

&lt;p&gt;An authentication setup for many users with certs from a given CA&lt;/p&gt;
&lt;pre&gt;
&lt;Directory [path to directory where the application lives, in quotes]&gt;
SSLOptions  +StdEnvVars +ExportCertData +OptRenegotiate +FakeBasicAuth
SSLVerifyClient   require
SSLVerifyDepth    5
SSLRequireSSL 
SSLRequire %{SSL_CLIENT_I_DN_CN} eq &quot;the CN of Issuer DN of client&#039;s certificate in quotes&quot;  
and %{SSL_CLIENT_S_DN_O} eq &quot;the O of Subject DN in client&#039;s certificate in quotes&quot;  
and %{SSL_CLIENT_S_DN_OU} eq &quot;&quot;the OU of Subject DN in client&#039;s certificate in quotes&quot;
&lt;/Directory&gt;
&lt;/pre&gt;
&lt;p&gt;From: &lt;a href=&quot;http://wiki.horde.org/HordeSSLAuthHowTo&quot; rel=&quot;nofollow&quot;&gt;HordeSSLAuthHowTo&lt;/a&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Two possible scenarios for X509 authentication follow:</p>
<p>A fairly strict authentication setup for one or two administrators</p>
<pre>&lt;Directory [absolute path to directory for service, in quotes]&gt;
SSLOptions  +StdEnvVars +ExportCertData +FakeBasicAuth +OptRenegotiate +CompatEnvVars
SSLVerifyClient   require
SSLVerifyDepth    5
SSLRequireSSL
SSLRequire %{SSL_CLIENT_I_DN_CN} eq "the CN of the Issuer DN of client&#039;s certificate in quotes"
and %{SSL_CLIENT_S_DN_O} eq "the O of the Subject DN in client&#039;s certificate in quotes"
and %{SSL_CLIENT_S_DN_CN} in {"the CN of one or more", "comma delimited Subject DNs in quotes"}
&lt;/Directory&gt;</pre>
<p>An authentication setup for many users with certs from a given CA</p>
<pre>&lt;Directory [path to directory where the application lives, in quotes]&gt;
SSLOptions  +StdEnvVars +ExportCertData +OptRenegotiate +FakeBasicAuth
SSLVerifyClient   require
SSLVerifyDepth    5
SSLRequireSSL
SSLRequire %{SSL_CLIENT_I_DN_CN} eq "the CN of Issuer DN of client&#039;s certificate in quotes"
and %{SSL_CLIENT_S_DN_O} eq "the O of Subject DN in client&#039;s certificate in quotes"
and %{SSL_CLIENT_S_DN_OU} eq ""the OU of Subject DN in client&#039;s certificate in quotes"
&lt;/Directory&gt;</pre>
<p>From: <a href="http://wiki.horde.org/HordeSSLAuthHowTo" rel="nofollow">HordeSSLAuthHowTo</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gert</title>
		<link>http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-46561</link>
		<dc:creator>Gert</dc:creator>
		<pubDate>Mon, 27 Oct 2008 14:59:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-46561</guid>
		<description>We are setting up an SSL area for our website and face this issue that the link is accessable through various methos causing SSL by passes. I like to gracefully solve this. But the complexity is that the SSL link is not the same as the HTTP links. The certificate is from our website provider.

The good link:
https://pepr-com.ssl.eatserver.nl/

The alternative way that does not compute to the SSL environment:
http://buydirect.pepr.com

The browsing method that does nto compute to the SSL environment:
http://www.pepr.com/buydirect

How do I combine the standard recommendation with the SEO version of it?
&lt;pre&gt;
SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq &quot;google.com&quot;
ErrorDocument 403 https://google.com
and
RewriteRule ^/normal/secure(/.*) https://%{HTTP_HOST}$1 [R=301,L]
&lt;/pre&gt;

I am a bit lost in this area and would ask the proper htaccess content to fix it. The complexity also sits in the fact that SSL is on a different link.</description>
		<content:encoded><![CDATA[<p>We are setting up an SSL area for our website and face this issue that the link is accessable through various methos causing SSL by passes. I like to gracefully solve this. But the complexity is that the SSL link is not the same as the HTTP links. The certificate is from our website provider.</p>
<p>The good link:<br />
https://pepr-com.ssl.eatserver.nl/</p>
<p>The alternative way that does not compute to the SSL environment:<br />
http://buydirect.pepr.com</p>
<p>The browsing method that does nto compute to the SSL environment:<br />
http://www.pepr.com/buydirect</p>
<p>How do I combine the standard recommendation with the SEO version of it?</p>
<pre>SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "google.com"
ErrorDocument 403 https://google.com
and
RewriteRule ^/normal/secure(/.*) https://%{HTTP_HOST}$1 [R=301,L]</pre>
<p>I am a bit lost in this area and would ask the proper htaccess content to fix it. The complexity also sits in the fact that SSL is on a different link.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josiah</title>
		<link>http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-45948</link>
		<dc:creator>Josiah</dc:creator>
		<pubDate>Mon, 06 Oct 2008 20:14:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-45948</guid>
		<description>Thanks, this article provided some great info and helped me to get where I wanted to be. I really appreciate it.</description>
		<content:encoded><![CDATA[<p>Thanks, this article provided some great info and helped me to get where I wanted to be. I really appreciate it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Payne</title>
		<link>http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-42291</link>
		<dc:creator>George Payne</dc:creator>
		<pubDate>Wed, 11 Jun 2008 16:15:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-42291</guid>
		<description>I was trying to do something I thought was simple,but have so far been unable to figure out.

I wanted set up a temp server just to host a &quot;we are down for the moment&quot; web page.  It&#039;s pretty easy to set it up so it responds to all http requests with a single page.  But I can&#039;t figure out how to set it up to answer all HTTPS requests with the same page without actually setting up SSL with a valid cert on my temporary server, which I don&#039;t want to do.


Any suggestions?  A wiser way of going about this?</description>
		<content:encoded><![CDATA[<p>I was trying to do something I thought was simple,but have so far been unable to figure out.</p>
<p>I wanted set up a temp server just to host a &#8220;we are down for the moment&#8221; web page.  It&#8217;s pretty easy to set it up so it responds to all http requests with a single page.  But I can&#8217;t figure out how to set it up to answer all HTTPS requests with the same page without actually setting up SSL with a valid cert on my temporary server, which I don&#8217;t want to do.</p>
<p>Any suggestions?  A wiser way of going about this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-5137</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Thu, 19 Apr 2007 18:46:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/apache-ssl-in-htaccess-examples.html#comment-5137</guid>
		<description>On an Apache 1.3x system, &quot;and&quot; &amp; &quot;or&quot; isn&#039;t valid inside an .htaccess file.  The use of &quot;&amp;&amp;&quot; and &quot;&#124;&#124;&quot; are required instead.

So where you list:
SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP&#124;NULL)-/ 
            and %{SSL_CLIENT_S_DN_O} eq &quot;Snake Oil, Ltd.&quot; 
            and %{SSL_CLIENT_S_DN_OU} in {&quot;Staff&quot;, &quot;CA&quot;, &quot;Dev&quot;} 
            and %{TIME_WDAY} &gt;= 1 and %{TIME_WDAY} &lt;= 5 
            and %{TIME_HOUR} &gt;= 8 and %{TIME_HOUR} &lt;= 20       ) 
           or %{REMOTE_ADDR} =~ m/^192.76.162.[0-9]+$/

It would have to be written as:

SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP&#124;NULL)-/ &amp;&amp; \
     %{SSL_CLIENT_S_DN_O} eq &quot;Snake Oil, Ltd.&quot; &amp;&amp; \
     %{SSL_CLIENT_S_DN_OU} in {&quot;Staff&quot;, &quot;CA&quot;, &quot;Dev&quot;} &amp;&amp; \
     %{TIME_WDAY} &gt;= 1 and %{TIME_WDAY} &lt;= 5 &amp;&amp; \
     %{TIME_HOUR} &gt;= 8 and %{TIME_HOUR} &lt;= 20) &#124;&#124; \
     %{REMOTE_ADDR} =~ m/^192.76.162.[0-9]+$/</description>
		<content:encoded><![CDATA[<p>On an Apache 1.3x system, &#8220;and&#8221; &#038; &#8220;or&#8221; isn&#8217;t valid inside an .htaccess file.  The use of &#8220;&#038;&#038;&#8221; and &#8220;||&#8221; are required instead.</p>
<p>So where you list:<br />
SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)-/<br />
            and %{SSL_CLIENT_S_DN_O} eq &#8220;Snake Oil, Ltd.&#8221;<br />
            and %{SSL_CLIENT_S_DN_OU} in {&#8220;Staff&#8221;, &#8220;CA&#8221;, &#8220;Dev&#8221;}<br />
            and %{TIME_WDAY} &gt;= 1 and %{TIME_WDAY} &lt;= 5<br />
            and %{TIME_HOUR} &gt;= 8 and %{TIME_HOUR} &lt;= 20       )<br />
           or %{REMOTE_ADDR} =~ m/^192.76.162.[0-9]+$/</p>
<p>It would have to be written as:</p>
<p>SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)-/ &#038;&#038; \<br />
     %{SSL_CLIENT_S_DN_O} eq &#8220;Snake Oil, Ltd.&#8221; &#038;&#038; \<br />
     %{SSL_CLIENT_S_DN_OU} in {&#8220;Staff&#8221;, &#8220;CA&#8221;, &#8220;Dev&#8221;} &#038;&#038; \<br />
     %{TIME_WDAY} &gt;= 1 and %{TIME_WDAY} &lt;= 5 &#038;&#038; \<br />
     %{TIME_HOUR} &gt;= 8 and %{TIME_HOUR} &lt;= 20) || \<br />
     %{REMOTE_ADDR} =~ m/^192.76.162.[0-9]+$/</p>
]]></content:encoded>
	</item>
</channel>
</rss>
