Bonjour à tous,
je dois dans mon application Web passer en mode sécurisé...
Pour cela, l'administrateur m'a donné les certificats dont j'ai besoin et je dois donc dire à l'application de faire confiance à ces certificats.

J'utilise un serveur LDAP pour l'authentification

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
<bean id="initialDirContextFactory"
		class="org.acegisecurity.ldap.DefaultInitialDirContextFactory">
		<constructor-arg
		value="ldaps://dfv2659.srv.u.yeah.com:636/dc=yeah " />
		<property name="managerDn">
			<value>uid=Application SEECOMM, ou=yeah international, dc=yeah</value>
		</property>
		<property name="managerPassword">
			<value>*******</value>
		</property>
	</bean>

J'ai créer un keystore à l'aide de keytool et j'ai importer mes certificats dedans...
puis j'ai mis dans mon tomcat xml

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
<Connector port="8443" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" disableUploadTimeout="true"
               acceptCount="100" debug="0" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" 
               keystoreFile="/DemoSEEWebApp/webseeapp.keystore"  
               truststoreFile="/DemoSEEWebApp/webseeapp.keystore" 
               truststorePass="changeit" 
               />
Je ne sais pas vraiment comment mettre en place les certificats, j'ai toujours pour l'instant l'erreur

[DEBUG,SEEAuthenticationProcessingFilter,http-8080-3] Updated SecurityContextHolder to contain null Authentication
[DEBUG,SEEAuthenticationProcessingFilter,http-8080-3] Authentication request failed: org.acegisecurity.AuthenticationServiceException: Unable to connect to LDAP server; nested exception is javax.naming.CommunicationException: simple bind failed: dfv2659.srv.u.yeah.com:636 [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]; nested exception is org.acegisecurity.ldap.LdapDataAccessException: Unable to connect to LDAP server; nested exception is javax.naming.CommunicationException: simple bind failed: dfv2659.srv.u.yeah.com:636[Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]