The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Certificate Expiry Dates srujana HP-UX 1 06-15-2008 10:35 PM
fetchmail imap gmail certificate c19h28O2 UNIX for Dummies Questions & Answers 13 03-11-2008 06:45 PM
Unix Certificate afuzile Forum Support Area for Unregistered Users & Account Problems 1 02-22-2006 04:17 AM
Mod_ssl patch for Apache server v2.0.49 e_jeffhang HP-UX 8 02-20-2006 02:20 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-16-2008
Registered User
 

Join Date: Jul 2002
Location: Sweden
Posts: 50
mod_ssl redirect to site if client does not have valid certificate

Hello!

I have setup a site to which users authenticate against with openssl certificates.
Everything works just fine, be I wish to be able to redirect to a error page with instructions instead of displaying the default error page that firefox displays.

How to? I got nothing out of google...

Best regards.
Reply With Quote
Forum Sponsor
  #2  
Old 07-16-2008
Moderator
 

Join Date: Sep 2007
Location: Germany
Posts: 1,031
Firefox displays only the error page that has been configured in your (I guess) Apache. Check your httpd.conf or a related include file where errors are defined like for example:

Code:
...
ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
...
Also check the official Apache documentation:
Custom Error Responses - Apache HTTP Server
Reply With Quote
  #3  
Old 07-16-2008
Registered User
 

Join Date: Jul 2002
Location: Sweden
Posts: 50
Ah I'm sorry! yes its apache.
Ok I will look into this!
Thank you for your response!
Reply With Quote
  #4  
Old 07-21-2008
Registered User
 

Join Date: Jul 2002
Location: Sweden
Posts: 50
Hello again, I've looked in to the httpd.conf but I cant figure out which error code apache generates and how to fetch it into an event.

What I know is that the server sends "SSL_ERROR_HANDSHAKE_FAILURE_ALERT" to the client, but I dont know how to use that error code to display an error page.

Please help
Reply With Quote
  #5  
Old 07-21-2008
Moderator
 

Join Date: Sep 2007
Location: Germany
Posts: 1,031
Can you check the Apache's access_log (or whatever it's name it is for the access log in your config) - the should be entries like for example:
Code:
10.10.1.23 - - [17/Jul/2008:07:07:47 +0200] "GET /somedir HTTP/1.1" 401 1446
The 401 is the error code in this example which is what you can configure in your httpd.conf or include file for it, afaik.
When you reproduce that "SSL_ERROR_HANDSHAKE_FAILURE_ALERT" error, you should check what kind of entry you get added in the access log I mentioned above. Maybe you can write a directive for that then like mentioned in one of my former answers.
Reply With Quote
  #6  
Old 07-22-2008
Registered User
 

Join Date: Jul 2002
Location: Sweden
Posts: 50
Hello!

Ah now I get what you mean!

xx.xx.xx.xx - - [22/Jul/2008:09:04:07 +0200] "GET /wiki/index.php/Main_Page HTTP/1.1" 403 -

This is what I get, I've added the following line in my vhost entry:
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var

But no success yet.
Reply With Quote
  #7  
Old 07-22-2008
Moderator
 

Join Date: Sep 2007
Location: Germany
Posts: 1,031
What error do you get in the browser window and in the logs of the webserver?

I can't describe it further - I would have to test it myself, so you will have to look up examples and try around, sorry.

Is the ErrorDocument directive placed inside the <Directory></Directory>?

Here you find the details on that directive:
core - Apache HTTP Server
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0