Configurar Liferay para acceso SSL

Siguiendo el articulo anterior.

Tenemos que configurar [Liferay home]/webapps/ROOT/WEB-INF/web.xml. En web-app/security-constraint/user-data-constraint/transport-guarantee cambiar NONE por CONFIDENTIAL

	<security-constraint>
		<user-data-constraint>
			<transport-guarantee>CONFIDENTIAL</transport-guarantee>
		</user-data-constraint>
	</security-constraint>

Arrancar y comprueba que puedes acceder a https://localhost:8443

documentacion:
liferay

Anuncios
Configurar Liferay para acceso SSL

Configurar Tomcat para acceso https

1. Generamos el keystore:

keytool -genkey -v -alias tomcat -keyalg RSA -validity 3650 -keysize 2048 -keystore keystore_tomcat.jks -storepass changeit -keypass changeit

2. en $CATALINA_HOME/conf/server.xml:

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000" 
               redirectPort="8443" />
 		
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
        maxThreads="150" scheme="https" secure="true"
        keystoreFile="C:Softwareliferayliferay-portal-6.1.1-ce-ga2_depotomcat-7.0.27confkeystore_tomcat.jks"
        keystorePass="changeit"
        clientAuth="false" sslProtocol="TLS" />
   	
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />

ERRORES:

SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-apr-8443"]
java.lang.Exception: El atribiuto del conector SSLCertificateFile debe de ser definido al usar SSL con APR
        at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:484)
        at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:566)
        at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:417)
        at org.apache.catalina.connector.Connector.initInternal(Connector.java:956)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
        at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
        at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:624)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:649)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:449)

abr 11, 2013 8:50:01 AM org.apache.catalina.core.StandardService initInternal
SEVERE: No pude inicializar el conector [Connector[HTTP/1.1-8443]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8443]]
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
        at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
        at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:624)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:649)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:449)
Caused by: org.apache.catalina.LifecycleException: Falló la inicialización del manejador de protocolo
        at org.apache.catalina.connector.Connector.initInternal(Connector.java:958)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
        ... 12 more
Caused by: java.lang.Exception: El atribiuto del conector SSLCertificateFile debe de ser definido al usar SSL con APR
        at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:484)
        at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:566)
        at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:417)
        at org.apache.catalina.connector.Connector.initInternal(Connector.java:956)
        ... 13 more

Esto quiere decir que por defecto esta configurado el protocolo APR. Para dejar por defecto el protocolo JSSE tenemos que editar el fichero server.xml cambiando la etiqueta protocol:

    <Connector port="8080" protocol="org.apache.coyote.http11.Http11Protocol"
               connectionTimeout="20000" 
               redirectPort="8443" />
 		
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
        maxThreads="150" scheme="https" secure="true"
        keystoreFile="C:Softwareliferayliferay-portal-6.1.1-ce-ga2_depotomcat-7.0.27confkeystore_tomcat.jks"
        keystorePass="changeit"
        clientAuth="false" sslProtocol="TLS" />
   	
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />

Arrancar y comprueba que puedes acceder a https://localhost:8443

documentacion:
http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html
http://java.dzone.com/articles/ssl-your-tomcat-7

Configurar Tomcat para acceso https