# Legitimate access with certificate auth or basic auth

**URL:** <https://www.ruby-forum.com/t/legitimate-access-with-certificate-auth-or-basic-auth/218959>\
**Category:** NGINX\
**Created:** [April 17, 2012, 1:24pm UTC](https://www.ruby-forum.com/t/legitimate-access-with-certificate-auth-or-basic-auth/218959 "2012-04-17T13:24:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurdipe\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Gurdipe\_D](https://www.ruby-forum.com/u/Gurdipe_D)\
**Post date:** [April 17, 2012, 1:24pm UTC](https://www.ruby-forum.com/t/legitimate-access-with-certificate-auth-or-basic-auth/218959/1 "2012-04-17T13:24:45Z")

</div>

Hi

Is there a way to legitimate access to a location (in my case an entire  
vhost) with certificate auth and - if no certificate is sent - a  
fallback to basic auth?

On Apache (from where I’m currently migrating) this is done with  
“FakeBasicAuth” as follows:

SSLVerifyClient require  
SSLVerifyDepth 3  
SSLCADNRequestFile /path/to/certs.pem  
SSLOptions +FakeBasicAuth

 Allow from all AuthName 'MySite' AuthType Basic AuthUserFile /path/to/htpasswd Require valid-user

Thanks for your hints!
