<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 12 February 2016 at 10:04, Marko Strukelj <span dir="ltr"><<a href="mailto:mstrukel@redhat.com" target="_blank">mstrukel@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When using 'truststore' provider it is up to you to make sure to<br>
include all the certificates you trust. Configuration via<br>
-Djavax.net.ssl.trustStore works the same - no automatic inclusion of<br>
cacerts. But it sounds like a good usability feature to add a flag<br>
that would automatically include cacerts as well. The problem is - it<br>
happens occasionally that some CAs turn out not to be trustworthy, and<br>
blindly importing all cacerts exposes you to that risk.<br></blockquote><div><br></div><div>How about having a flag that is enabled by default that includes cacerts from Java? I'd actually think that update from CA certs are more likely going to happen by updating Java rather than manually maintaining a truststore.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
One detail to emphasize, with third party not-self-signed certificates<br>
it's important to include the CA certificate used to create the<br>
specific server certificate, rather than the server certificate<br>
itself. Facebook servers use different short-lived server certificates<br>
- and with two consecutive requests you may be presented with two<br>
different server certificates - but they are all issued by the same<br>
long-lived trusted CA. </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
<br>
On Fri, Feb 12, 2016 at 8:07 AM, Marek Posolda <<a href="mailto:mposolda@redhat.com">mposolda@redhat.com</a>> wrote:<br>
> Facebook certificate should be signed by trusted authority, so it works with<br>
> default JDK truststore. At least for me it always works.<br>
><br>
> Shouldn't truststore SPI use both provided file + default JDK truststore by<br>
> default? We may have flag to disable default JDK truststore, but not sure if<br>
> it's ever needed. Also shouldn't we rewrite SimpleHTTP to use Apache HTTP<br>
> client provided by HttpClientProvider SPI?<br>
><br>
> Marek<br>
><br>
><br>
> On 11/02/16 15:23, Stian Thorgersen wrote:<br>
><br>
> Does it work if you don't specify the truststore? That will use the default<br>
> truststore provided by the JDK.<br>
><br>
> Also, does your truststore contain the required CA certs? For Facebook to<br>
> work it'll have to contain the required CA's for their certs<br>
><br>
> On 11 February 2016 at 14:09, LEONARDO NUNES <<a href="mailto:leo.nunes@gjccorp.com.br">leo.nunes@gjccorp.com.br</a>><br>
> wrote:<br>
>><br>
>> Hi, i'm getting the error below when I try to login with Facebook.<br>
>> I've followed the instructions at<br>
>> <a href="http://keycloak.github.io/docs/userguide/keycloak-server/html/server-installation.html#truststore" rel="noreferrer" target="_blank">http://keycloak.github.io/docs/userguide/keycloak-server/html/server-installation.html#truststore</a><br>
>> and<br>
>> <a href="http://keycloak.github.io/docs/userguide/keycloak-server/html/server-installation.html#d4e337" rel="noreferrer" target="_blank">http://keycloak.github.io/docs/userguide/keycloak-server/html/server-installation.html#d4e337</a><br>
>><br>
>> I was able to login with Facebook when trying at localhost. But at our<br>
>> development server we are getting this error.<br>
>><br>
>> We are using EAP in domain mode.<br>
>><br>
>> The truststore I placed inside of keycloak-server.json<br>
>> "truststore": {<br>
>> "file": {<br>
>> "file": "/home/soa/jboss/ssl/keycloak.jks",<br>
>> "password": "keycloak123",<br>
>> "hostname-verification-policy": "ANY",<br>
>> "disabled": false<br>
>> }<br>
>> }<br>
>><br>
>><br>
>> #######<br>
>><br>
>> ERRO:<br>
>><br>
>><br>
>> 2016-02-11 10:44:53,927 ERROR<br>
>> [org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider]<br>
>> (ajp-/192.168.162.73:8008-1) Failed to make identity provider oauth<br>
>> callback: javax.net.ssl.SSLHandshakeException:<br>
>> sun.security.validator.ValidatorException: PKIX path building failed:<br>
>> sun.security.provider.certpath.SunCertPathBuilderException: unable to find<br>
>> valid certification path to requested target<br>
>> at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1937)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at<br>
>> sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1478)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at<br>
>> sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:212)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at sun.security.ssl.Handshaker.processLoop(Handshaker.java:969)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at sun.security.ssl.Handshaker.process_record(Handshaker.java:904)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1050)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at<br>
>> sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1375)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at<br>
>> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)<br>
>> [rt.jar:1.8.0_45]<br>
>> at<br>
>> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)<br>
>> [rt.jar:1.8.0_45]<br>
>> at<br>
>> sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1282)<br>
>> [rt.jar:1.8.0_45]<br>
>> at<br>
>> sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1257)<br>
>> [rt.jar:1.8.0_45]<br>
>> at<br>
>> sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)<br>
>> [rt.jar:1.8.0_45]<br>
>> at<br>
>> org.keycloak.broker.provider.util.SimpleHttp.asString(SimpleHttp.java:124)<br>
>> at<br>
>> org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider$Endpoint.authResponse(AbstractOAuth2IdentityProvider.java:228)<br>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
>> [rt.jar:1.8.0_45]<br>
>> at<br>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)<br>
>> [rt.jar:1.8.0_45]<br>
>> at<br>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
>> [rt.jar:1.8.0_45]<br>
>> at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_45]<br>
>> at<br>
>> org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167)<br>
>> [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]<br>
>> at<br>
>> org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269)<br>
>> [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]<br>
>> at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227)<br>
>> [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]<br>
>> at<br>
>> org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:159)<br>
>> [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]<br>
>> at<br>
>> org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:107)<br>
>> [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]<br>
>> at<br>
>> org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:154)<br>
>> [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]<br>
>> at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:92)<br>
>> [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]<br>
>> at<br>
>> org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542)<br>
>> [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]<br>
>> at<br>
>> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)<br>
>> [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]<br>
>> at<br>
>> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126)<br>
>> [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]<br>
>> at<br>
>> org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)<br>
>> [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]<br>
>> at<br>
>> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)<br>
>> [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]<br>
>> at<br>
>> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)<br>
>> [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]<br>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)<br>
>> [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]<br>
>> at<br>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)<br>
>> [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]<br>
>> at<br>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)<br>
>> [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]<br>
>> at<br>
>> org.keycloak.services.filters.KeycloakSessionServletFilter.doFilter(KeycloakSessionServletFilter.java:61)<br>
>> [keycloak-services-1.8.1.Final.jar:1.8.1.Final]<br>
>> at<br>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)<br>
>> [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]<br>
>> at<br>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)<br>
>> [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]<br>
>> at<br>
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)<br>
>> [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]<br>
>> at<br>
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)<br>
>> [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]<br>
>> at<br>
>> org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:91)<br>
>> at<br>
>> org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:72)<br>
>> at<br>
>> org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)<br>
>> [jboss-as-web-7.4.3.Final-redhat-2.jar:7.4.3.Final-redhat-2]<br>
>> at<br>
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)<br>
>> [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]<br>
>> at<br>
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)<br>
>> [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]<br>
>> at<br>
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)<br>
>> [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]<br>
>> at<br>
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)<br>
>> [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]<br>
>> at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:490)<br>
>> [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]<br>
>> at<br>
>> org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:420)<br>
>> [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]<br>
>> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)<br>
>> [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]<br>
>> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]<br>
>> Caused by: sun.security.validator.ValidatorException: PKIX path building<br>
>> failed: sun.security.provider.certpath.SunCertPathBuilderException: unable<br>
>> to find valid certification path to requested target<br>
>> at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)<br>
>> [rt.jar:1.8.0_45]<br>
>> at<br>
>> sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)<br>
>> [rt.jar:1.8.0_45]<br>
>> at sun.security.validator.Validator.validate(Validator.java:260)<br>
>> [rt.jar:1.8.0_45]<br>
>> at<br>
>> sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at<br>
>> sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at<br>
>> sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)<br>
>> [jsse.jar:1.8.0_45]<br>
>> at<br>
>> sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1460)<br>
>> [jsse.jar:1.8.0_45]<br>
>> ... 50 more<br>
>> Caused by: sun.security.provider.certpath.SunCertPathBuilderException:<br>
>> unable to find valid certification path to requested target<br>
>> at<br>
>> sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:145)<br>
>> [rt.jar:1.8.0_45]<br>
>> at<br>
>> sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:131)<br>
>> [rt.jar:1.8.0_45]<br>
>> at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)<br>
>> [rt.jar:1.8.0_45]<br>
>> at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)<br>
>> [rt.jar:1.8.0_45]<br>
>> ... 56 more<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Leonardo Nunes<br>
>> ________________________________<br>
>> Esta mensagem pode conter informação confidencial e/ou privilegiada. Se<br>
>> você não for o destinatário ou a pessoa autorizada a receber esta mensagem,<br>
>> não poderá usar, copiar ou divulgar as informações nela contidas ou tomar<br>
>> qualquer ação baseada nessas informações. Se você recebeu esta mensagem por<br>
>> engano, por favor avise imediatamente o remetente, respondendo o e-mail e em<br>
>> seguida apague-o. Agradecemos sua cooperação.<br>
>><br>
>> This message may contain confidential and/or privileged information. If<br>
>> you are not the addressee or authorized to receive this for the addressee,<br>
>> you must not use, copy, disclose or take any action based on this message or<br>
>> any information herein. If you have received this message in error, please<br>
>> advise the sender immediately by reply e-mail and delete this message. Thank<br>
>> you for your cooperation<br>
>><br>
>> _______________________________________________<br>
>> keycloak-user mailing list<br>
>> <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> keycloak-user mailing list<br>
> <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> keycloak-user mailing list<br>
> <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
</div></div></blockquote></div><br></div></div>