My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
AutentificacionDNIeTomcat  
Documento en el que se explica como configurar Tomcat para hacer autentificación de usuarios con certificado electrónico
Updated Apr 30, 2010 by jgzorn...@gmail.com

Introduction

Add your content here.

Detalles

Poner en server.xml:

<!-- Define a SSL HTTP/1.1 Connector on port 8443. This connector uses the JSSE configuration, when using APR, the connector should be using the OpenSSL style configuration described in the APR documentation -->

    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="true" sslProtocol="TLS"                
	       keystoreFile="/home/jj/opt/apache-tomcat-6.0.20/keystore/serverKeystore.jks"
               keystorePass="passwordKeystore"
               truststoreFile="/home/jj/opt/apache-tomcat-6.0.20/keystore/trustKeystore_dnie.jks"
               truststorePass="passwordTruststorePass" />
  • Poniendo el valor del parámetro clientAuth true el servidor pedirá para el acceso a los recursos un certificado que cumpla con la cadena de certificación almacenada en trustKeystore_dnie.jks.

Forzar las comunicaciones con el protocolo HTTPS

Para forzar las comunicaciones a través del protocolo HTTPS, añadir en el web.xml:

<security-constraint>
     <web-resource-collection>
        <web-resource-name>Protected Context</web-resource-name>
          <url-pattern>/*</url-pattern>
      </web-resource-collection>
      <!-- auth-constraint goes here if you requre authentication -->
      <user-data-constraint>
         <transport-guarantee>CONFIDENTIAL</transport-guarantee>
      </user-data-constraint>
   </security-constraint>

De esta forma Tomcat redireccionará cualquier petición HTTP al contexto hacia el conector HTTPS

Enlaces de interés

Creación de almacenes de claves

Como configurar SSL con Tomcat

Tomcat Server/Client Self-Signed SSL Certificate

Powered by Google Project Hosting