Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

replacing SnakeOil default Apache server certificate

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  httpd.conf permissions  
Author Message
roychew

External


Since: Jul 17, 2003
Posts: 2



(Msg. 1) Posted: Thu Jul 17, 2003 4:08 pm
Post subject: replacing SnakeOil default Apache server certificate
Archived from groups: alt>apache>configuration (more info?)

Hello,

How does one replace the default Apache server's certificate issued
as SnakeOil with one's own server certificate when an improvised URL
https://www.abc.org:443 is entered and a server certificate served?
Can one work with server and client certificates simultaneously? Is it
one or the other?
I'm working with Apache 2.0.46 on Windows 2000 prof. with SSL module
and LDAP module configured. All my client, server and CA certificates
and keys are prepared for client and server authentications. I haven't
got anything to work yet. My aim is to do client authentication for
access to LDAP server through Apache on Windows.
Can anyone kindly help me out?
Thank you in advance for any help provided.

Roy
-------------------
The configurations are set in httpd.conf and ssl.conf with the
relevant snippet of it as follows:

https.conf
----------
<IfModule mod_ssl.c>
Include conf/ssl.conf
</IfModule>

ssl.conf
--------
<IfDefine SSL>
Listen 127.0.0.1:443
## SSL Virtual Host Context
NameVirtualHost 127.0.0.1:443
<VirtualHost 127.0.0.1:443>

# General setup for the virtual host
DocumentRoot "c:/Apache2/htdocs"
ServerName www.abc.org
ServerAdmin roychew.RemoveThis@hotmail.com
ErrorLog logs/error_log
TransferLog logs/access_log
SSLLog logs/ssl.log
SSLLogLevel debug
SSLSessionCache
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

# Server Certificate:
SSLCertificateFile c:/Apache2/conf/certs/abc.crt

# Server Private Key:
SSLCertificateKeyFile c:/Apache2/conf/private/abc.key

# Server Certificate Chain:
#SSLCertificateChainFile c:/Apache/conf/ssl.crt/ca.crt

# Certificate Authority (CA):
SSLCACertificateFile c:/Apache2/conf/certs/ca.crt
SSLCACertificatePath c:/Apache2/conf/certs
SSLOptions +FakeBasicAuth
SSLRequireSSL
SSLRequire %{SSL_CLIENT_S_DN_O} eq "ABC Consulting, Inc." \
and %{SSL_CLIENT_S_DN_OU} in {"Consulting", "California",
"employees"}
SSLVerifyClient require
SSLVerifyDepth 1
</VirtualHost>
<IfDefine>

 >> Stay informed about: replacing SnakeOil default Apache server certificate 
Back to top
Login to vote
user2348

External


Since: Jun 28, 2003
Posts: 203



(Msg. 2) Posted: Fri Jul 18, 2003 12:37 am
Post subject: Re: replacing SnakeOil default Apache server certificate [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"RoyCTC" <roychew.RemoveThis@hotmail.com> wrote in message
news:2cdd170a.0307171208.245261d2@posting.google.com...
 > Hello,
 >
 > How does one replace the default Apache server's certificate issued
 > as SnakeOil with one's own server certificate when an improvised URL
 > <a style='text-decoration: underline;' href="https://www.abc.org:443" target="_blank">https://www.abc.org:443</a> is entered and a server certificate served?
 > Can one work with server and client certificates simultaneously? Is it
 > one or the other?

To create a self signed certificate:
openssl.exe req -config openssl.cnf -new -nodes -out server.csr -keyout
server.key
openssl.exe x509 -in server.csr -out server.crt -req -signkey
server.key -days 365 -set_serial 1
(Increment the serial number each time you create a certificate.)

Make sure you enter your host name (e.g. <a style='text-decoration: underline;' href="http://www.abc.org" target="_blank">www.abc.org</a>) for the Common Name,
when prompted.

This assumes you have openssl.exe and openssl.cnf, if not you can grab them
from:
<a style='text-decoration: underline;' href="http://rab.members.easyspace.com/apache-ssl/" target="_blank">http://rab.members.easyspace.com/apache-ssl/</a>

Richard.<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: replacing SnakeOil default Apache server certificate 
Back to top
Login to vote
roychew

External


Since: Jul 17, 2003
Posts: 2



(Msg. 3) Posted: Fri Jul 18, 2003 9:13 pm
Post subject: Apache server and client certificates authentication on Windows [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 > To create a self signed certificate:
 > openssl.exe req -config openssl.cnf -new -nodes -out server.csr -keyout
 > server.key
 > openssl.exe x509 -in server.csr -out server.crt -req -signkey
 > server.key -days 365 -set_serial 1
 > (Increment the serial number each time you create a certificate.)
 >
 > Make sure you enter your host name (e.g. <a style='text-decoration: underline;' href="http://www.abc.org" target="_blank">www.abc.org</a>) for the Common Name,
 > when prompted.
 >
 > This assumes you have openssl.exe and openssl.cnf, if not you can grab them
 > from:
<font color=purple> > <a style='text-decoration: underline;' href="http://rab.members.easyspace.com/apache-ssl/</font" target="_blank">http://rab.members.easyspace.com/apache-ssl/</font</a>>
 >
 > Richard.

Thank you Richard for the quick response and help.
In completeness, I compile the following guide of successfully
achieving my aims.

The Ways to Prepare a Web Site for Server and Client Authentications
==================================================
Purpose: To establish server and client authentications for a web site
using self-signed certificates and
done locally on a localhost for testing on Windows.

Software and Platform
Apache 2.0.46 for Win32
Microsoft 2000 Professional
IE 5.5
Openssl 0.9.7b

The followings are important statements and steps taken to configure
Apache's configuration file httpd.conf

# Mod_ssl module loaded with the statement
LoadModule ssl_module modules/mod_ssl.so

ServerName localhost

<IfModule mod_ssl.c>
Include conf/ssl.conf
</IfModule>

The above directive will read the SSL configuration file, ssl.conf
which consists of the following few
important statements:

<IfDefine SSL>
  Listen 8443
  AddType application/x-x509-ca-cert .crt
  AddType application/x-pkcs7-crl .crl

  <VirtualHost _default_:8443>

   # General setup for the virtual host
   DocumentRoot "C:/Apache2/htdocs"
   ServerName localhost
   ServerAdmin roychew.DeleteThis@hotmail.com
   ErrorLog logs/error.log
  TransferLog logs/access_log
   LogLevel warn
   SSLEngine on
SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

   SSLCertificateFile C:/Apache2/conf/demoCA/my-server.der.crt
   SSLCertificateKeyFile C:/Apache2/conf/demoCA/my-server.key

   SSLCACertificateFile C:/Apache2/conf/demoCA/my-server.cert
   SSLCACertificatePath C:/Apache2/conf/demoCA

   SSLVerifyClient require
   SSLVerifyDepth 1

   SetEnvIf User-Agent ".*MSIE.*" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0

   <Directory "C:/Apache2/htdocs">
    SSLRequireSSL
    SSLVerifyClient require
    SSLVerifyDepth 1
   </Directory>
  </VirtualHost>
</IfDefine>


Preparations of Certificates
---------------------------------
I've placed all the requests, certificates and keys in a common folder
called demoCA.

I run openssl from the conf subdirectory because I have placed my
openssl.cnf file there.

Run the following commands using the openssl tool to create server's
request, key and certificate

 > openssl req -config openssl.cnf -new -nodes -out demoCA/my-server.csr -keyout demoCA/my-server.key
 > openssl x509 -in demoCA/my-server.csr -out demoCA/my-server.cert -req -signkey demoCA/my-
server.key -days 365 -set_serial 1
 > openssl x509 -in demoCA/my-server.cert -out demoCA/my-server.der.crt -outform DER

While prompted for CN during certificate preparation of the above, I
chose "localhost" as the common name.
Hence, while preparing the client certificate, "localhost" should be
entered for the CN to match it.
Issued by: "localhost" would then appear in the browser's window after
the certificates are installed into
it.
It's important to match them if not Apache would consider it as an
error when a secured connection is
attempted and will be logged for affirmation.

Run the following commands using the openssl tool to create client's
request, key and certificate

 > openssl req -config openssl.cnf -new -out demoCA/clienta.csr -keyout demoCA/clientakey.pem
 > openssl x509 -req -in demoCA/clienta.csr -out demoCA/clienta.pem -CA demoCA/my-server.cert
-CAkey demoCA/my-server.key -CAcreateserial -days 365 -outform
PEM
 > openssl pkcs12 -export -in demoCA/clienta.pem -out demoCA/clienta.p12 -inkey
demoCA/clientakey.pem -name "Test User"


Start apache with
$> apache -D SSL -e warn -k start

Beware that by starting Apache Monitor service on windows would not
set SSL directive option as above

If the server certificate is not installed before connecting to the
web site, the server will prompt user's
browser to accept server's certificate.

IE 5.5 browser changes made in order to get the window prompt for
client certificate, with client certificate
installed beforehand, while connecting to web site. Setting for local
intranet because I used localhost.

Then try to access <a style='text-decoration: underline;' href="https://localhost:8443" target="_blank">https://localhost:8443</a>

That's about it for certificates. Yet to do the LDAP part.
Roy<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: replacing SnakeOil default Apache server certificate 
Back to top
Login to vote
user2348

External


Since: Jun 28, 2003
Posts: 203



(Msg. 4) Posted: Sat Jul 19, 2003 11:27 am
Post subject: Re: Apache server and client certificates authentication on Windows [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"RoyCTC" <roychew.RemoveThis@hotmail.com> wrote in message
news:2cdd170a.0307181713.5b3384f6@posting.google.com...

 > Start apache with
 > $> apache -D SSL -e warn -k start
 >
 > Beware that by starting Apache Monitor service on windows would not
 > set SSL directive option as above

And the easiest way around that, is just to remove/comment out the <IfDefine
SSL> and matching </IfDefine> from the ssl.conf file. If you plan to run
with SSL and you don't need the quick and easy way to enable/disable it from
the command line, then these really aren't required.

Richard.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: replacing SnakeOil default Apache server certificate 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Default/Virtual server ? - I am new to apache 2.0.40 running on Linux and although I have it working I am unsure what is the best way configure 2 IP based hosts. Example configurations: 1. One IP as default server, one as virtual or 2. One IP as virtual, 2nd IP as virtual, wit...

Running Firewall on Apache Server - Is running an Apache Server on a 2 x nic system (local and Internet) and then using Linux firewall to lock down all put port 80 on the internet side a viable option or am I leaving myself more open than if I ran a seprate firewall? Cheers Tim

Apache Server side include character limits - I was wondering if there is a way to change the character limit on a server side include. I was including a page and it cuts off at 32000 characters. is this a default that can be changed? Any help would be great! Corey

default.ida - I am getting someone accessing myserver.com/default.ida?XXXXXXXXXXXXXXXXXXXXXX which I would like to block. Any suggestions? It is from different IPs and when I do it manually myself, the server does not send any data so I guess that this is a form of..

I got a problem with Apache & PHP. - First off, I'm trying to get PHP working with Apache. I added this line to my httpd.conf: AddType application/x-httpd-php .php and I have set index.php to the default index page. When I go to my test page (index.php) with a little <? print(Date(&quot...
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]