<div dir="ltr">I think I&#39;ve just found the reason why we can not migrate in OpenSSL by default :(<div><br></div><div>In server scenario we obtain S<b>SL</b>Context (the one from JDK; Netty has similar S<b>sl</b>Context) from WildFly. It is already configured along with sercurity realms, domains etc. We then get into this branch of code [1].</div><div><br></div><div>In order to do fancy things like SNI we need to remap JDK&#39;s SSLContext into Netty&#39;s SslContext and the only implementation that can consume SSLContext we have at hand is JdkSslContext.</div><div><br></div><div>I honestly have no idea how we could refactor this... And that&#39;s a shame because OpenSSL is way faster...</div><div><br></div><div>[1] <a href="https://github.com/infinispan/infinispan/blob/830b5314e5d6763aff239584026a7a9d15f01666/server/core/src/main/java/org/infinispan/server/core/utils/SslUtils.java#L29-L29">https://github.com/infinispan/infinispan/blob/830b5314e5d6763aff239584026a7a9d15f01666/server/core/src/main/java/org/infinispan/server/core/utils/SslUtils.java#L29-L29</a></div><div><br><div class="gmail_quote"><div dir="ltr">On Fri, Mar 31, 2017 at 6:02 PM Tristan Tarrant &lt;<a href="mailto:ttarrant@redhat.com">ttarrant@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You want to use OpenSSL with Netty:<br>
<br>
<a href="http://netty.io/wiki/requirements-for-4.x.html#wiki-h4-4" rel="noreferrer" target="_blank">http://netty.io/wiki/requirements-for-4.x.html#wiki-h4-4</a><br>
<br>
Tristan<br>
<br>
On 31/03/2017 15:55, Sebastian Laskawiec wrote:<br>
&gt; Unfortunately TLS still slows down stuff (a lot). When I was doing tests<br>
&gt; for the multi-tenancy router (which is based on TLS/SNI), my average<br>
&gt; results were like this:<br>
&gt;<br>
&gt; Use-caseTypeAvgError<br>
&gt; initConnectionAndPerform10KPutsSingleServerNoSsl1034.81714.424<br>
&gt; initConnectionAndPerform10KPutsSingleServerWithSsl1567.55324.872<br>
&gt; initConnectionAndPerform10KPutsTwoServersWithSslSni1563.22934.05<br>
&gt; initConnectionOnlySingleServerNoSsl*3.389*0.198<br>
&gt; initConnectionOnlySingleServerWithSsl*14.086*0.794<br>
&gt; initConnectionOnlyTwoServersWithSslSni*14.722*0.684<br>
&gt; perform10KPutsSingleServerNoSsl*4.602*0.585<br>
&gt; perform10KPutsSingleServerWithSsl*16.583*0.198<br>
&gt; perform10KPutsTwoServersWithSslSni*17.02*0.794<br>
&gt;<br>
&gt; This is nothing new, but initializing Hot Rod connection took was ~4<br>
&gt; times slower and putting 10K random strings (UUIDs) was also ~4 times<br>
&gt; slower. But what&#39;s worth to mention, there is no significant difference<br>
&gt; between TLS and TLS+SNI.<br>
&gt;<br>
&gt; As far as I know, it is possible to install specialized hardware to deal<br>
&gt; with encryption in data centers. It is called SSL Acceleration [1].<br>
&gt; However I&#39;m not aware of any special processor instructions that can<br>
&gt; help you with that. But the implementations are getting better and<br>
&gt; better, so who knows...<br>
&gt;<br>
&gt; But getting back to the original question, I think the problem we are<br>
&gt; trying to solve (correct me if I&#39;m wrong) is to prevent unauthorized<br>
&gt; folks to put their hands on a victims data (either pushing something<br>
&gt; malicious/corrupted to the cache or obtaining something from the cache).<br>
&gt; Another problem is transmission security - encryption. If we want our<br>
&gt; new devs to be secured out of the box, I think we should do both - use<br>
&gt; TLS (without trusting all certificated) and authentication. This makes<br>
&gt; Infinispan harder to use of course. So the other extremum is to turn<br>
&gt; both things off.<br>
&gt;<br>
&gt; I voted for the latter, making Infinispan super easy to use. But you<br>
&gt; guys convinced me that we should care about the security in this case<br>
&gt; too, so I would use PLAIN authentication + TLS. I would also love to see<br>
&gt; one magic switch, for example `./bin/standalone.sh --dev-mode`, which<br>
&gt; would turn all security off.<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Sebastian<br>
&gt;<br>
&gt; [1] <a href="https://en.wikipedia.org/wiki/SSL_acceleration" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/SSL_acceleration</a><br>
&gt;<br>
&gt;<br>
&gt; On Thu, Mar 30, 2017 at 9:22 PM Dan Berindei &lt;<a href="mailto:dan.berindei@gmail.com" target="_blank">dan.berindei@gmail.com</a><br>
&gt; &lt;mailto:<a href="mailto:dan.berindei@gmail.com" target="_blank">dan.berindei@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     I agree with Radim, PLAIN authentication without encryption makes it<br>
&gt;     too easy to sniff the password from another machine.<br>
&gt;<br>
&gt;     I have no idea how expensive SSL encryption is in WildFly, but I think<br>
&gt;     all recent processors have specialized instructions for helping with<br>
&gt;     encryption, so it may not be that bad.<br>
&gt;<br>
&gt;     Even with encryption, if the client trusts all certs, it may be<br>
&gt;     possible for an attacker to insert itself in the middle and decode<br>
&gt;     everything -- depending on network topology and what kind of access<br>
&gt;     the attacker already has. I think it only makes sense to trust all<br>
&gt;     certs if we also implement something like HPKP [1], to make it more<br>
&gt;     like ssh.<br>
&gt;<br>
&gt;     [1]: <a href="https://en.wikipedia.org/wiki/HTTP_Public_Key_Pinning" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/HTTP_Public_Key_Pinning</a><br>
&gt;<br>
&gt;     Cheers<br>
&gt;     Dan<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;     On Thu, Mar 30, 2017 at 7:07 PM, Wolf Fink &lt;<a href="mailto:wfink@redhat.com" target="_blank">wfink@redhat.com</a><br>
&gt;     &lt;mailto:<a href="mailto:wfink@redhat.com" target="_blank">wfink@redhat.com</a>&gt;&gt; wrote:<br>
&gt;      &gt; +1 to make the default secure.<br>
&gt;      &gt;<br>
&gt;      &gt; -1 SSL by default as it makes it slower and I think not most will<br>
&gt;     use it<br>
&gt;      &gt;<br>
&gt;      &gt; -1 easy trust all certs, That sounds to me we close one door and<br>
&gt;     make it<br>
&gt;      &gt; possible to open another one<br>
&gt;      &gt;<br>
&gt;      &gt;<br>
&gt;      &gt; What if we add an example configuration unsecured which can be<br>
&gt;     simple copied<br>
&gt;      &gt; for examples and to start.<br>
&gt;      &gt;<br>
&gt;      &gt;<br>
&gt;      &gt; On Thu, Mar 30, 2017 at 5:31 PM, Dennis Reed &lt;<a href="mailto:dereed@redhat.com" target="_blank">dereed@redhat.com</a><br>
&gt;     &lt;mailto:<a href="mailto:dereed@redhat.com" target="_blank">dereed@redhat.com</a>&gt;&gt; wrote:<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; +1 to authentication and encryption by default.<br>
&gt;      &gt;&gt;   This is 2017, that&#39;s how *everything* should be configured.<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; -1 to making it easy to trust all certs.  That negates the point of<br>
&gt;      &gt;&gt; using encryption in the first place and should really never be done.<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; If it&#39;s too hard to configure the correct way that we think it would<br>
&gt;      &gt;&gt; turn users away, that&#39;s a usability problem that needs to be fixed.<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; -Dennis<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; On 03/30/2017 09:29 AM, Tristan Tarrant wrote:<br>
&gt;      &gt;&gt; &gt; While the &quot;unsecure&quot; over loopback is quite tempting, I would<br>
&gt;     prefer to<br>
&gt;      &gt;&gt; &gt; have homogeneous behaviour with the possibility to disable<br>
&gt;     security<br>
&gt;      &gt;&gt; &gt; altogether for quick demos.<br>
&gt;      &gt;&gt; &gt; Otherwise a developer would need to code differently for the<br>
&gt;     local use<br>
&gt;      &gt;&gt; &gt; case than for the remote one, causing more confusion.<br>
&gt;      &gt;&gt; &gt;<br>
&gt;      &gt;&gt; &gt; Tristan<br>
&gt;      &gt;&gt; &gt;<br>
&gt;      &gt;&gt; &gt; On 30/03/2017 14:54, Sebastian Laskawiec wrote:<br>
&gt;      &gt;&gt; &gt;&gt; I agree the security out of the box is good. But at the same<br>
&gt;     time we<br>
&gt;      &gt;&gt; &gt;&gt; don&#39;t want to make Infinispan harder to use for new<br>
&gt;     developers. Out of<br>
&gt;      &gt;&gt; &gt;&gt; the box configuration should be &quot;good enough&quot; to start hacking.<br>
&gt;      &gt;&gt; &gt;&gt;<br>
&gt;      &gt;&gt; &gt;&gt; I would propose to make all the endpoints unprotected (with<br>
&gt;      &gt;&gt; &gt;&gt; authentication disabled) on localhost/loopback and protected when<br>
&gt;      &gt;&gt; &gt;&gt; calling from the outside world.<br>
&gt;      &gt;&gt; &gt;&gt;<br>
&gt;      &gt;&gt; &gt;&gt; On Thu, Mar 30, 2017 at 2:39 PM Tristan Tarrant<br>
&gt;     &lt;<a href="mailto:ttarrant@redhat.com" target="_blank">ttarrant@redhat.com</a> &lt;mailto:<a href="mailto:ttarrant@redhat.com" target="_blank">ttarrant@redhat.com</a>&gt;<br>
&gt;      &gt;&gt; &gt;&gt; &lt;mailto:<a href="mailto:ttarrant@redhat.com" target="_blank">ttarrant@redhat.com</a> &lt;mailto:<a href="mailto:ttarrant@redhat.com" target="_blank">ttarrant@redhat.com</a>&gt;&gt;&gt; wrote:<br>
&gt;      &gt;&gt; &gt;&gt;<br>
&gt;      &gt;&gt; &gt;&gt;     Dear all,<br>
&gt;      &gt;&gt; &gt;&gt;<br>
&gt;      &gt;&gt; &gt;&gt;     after a mini chat on IRC, I wanted to bring this to<br>
&gt;     everybody&#39;s<br>
&gt;      &gt;&gt; &gt;&gt;     attention.<br>
&gt;      &gt;&gt; &gt;&gt;<br>
&gt;      &gt;&gt; &gt;&gt;     We should make the Hot Rod endpoint require<br>
&gt;     authentication in the<br>
&gt;      &gt;&gt; &gt;&gt;     out-of-the-box configuration.<br>
&gt;      &gt;&gt; &gt;&gt;     The proposal is to enable the PLAIN (or, preferably,<br>
&gt;     DIGEST) SASL<br>
&gt;      &gt;&gt; &gt;&gt;     mechanism against the ApplicationRealm and require users<br>
&gt;     to run the<br>
&gt;      &gt;&gt; &gt;&gt;     add-user script.<br>
&gt;      &gt;&gt; &gt;&gt;     This would achieve two goals:<br>
&gt;      &gt;&gt; &gt;&gt;     - secure out-of-the-box configuration, which is always a<br>
&gt;     good idea<br>
&gt;      &gt;&gt; &gt;&gt;     - access to the &quot;protected&quot; schema and script caches which is<br>
&gt;      &gt;&gt; &gt;&gt; prevented<br>
&gt;      &gt;&gt; &gt;&gt;     when not on loopback on non-authenticated endpoints.<br>
&gt;      &gt;&gt; &gt;&gt;<br>
&gt;      &gt;&gt; &gt;&gt;     Tristan<br>
&gt;      &gt;&gt; &gt;&gt;     --<br>
&gt;      &gt;&gt; &gt;&gt;     Tristan Tarrant<br>
&gt;      &gt;&gt; &gt;&gt;     Infinispan Lead<br>
&gt;      &gt;&gt; &gt;&gt;     JBoss, a division of Red Hat<br>
&gt;      &gt;&gt; &gt;&gt;     _______________________________________________<br>
&gt;      &gt;&gt; &gt;&gt;     infinispan-dev mailing list<br>
&gt;      &gt;&gt; &gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt;     &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt;      &gt;&gt; &gt;&gt; &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt;     &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;&gt;<br>
&gt;      &gt;&gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;      &gt;&gt; &gt;&gt;<br>
&gt;      &gt;&gt; &gt;&gt;<br>
&gt;      &gt;&gt; &gt;&gt;<br>
&gt;      &gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;      &gt;&gt; &gt;&gt; infinispan-dev mailing list<br>
&gt;      &gt;&gt; &gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt;     &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt;      &gt;&gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;      &gt;&gt; &gt;&gt;<br>
&gt;      &gt;&gt; &gt;<br>
&gt;      &gt;&gt; _______________________________________________<br>
&gt;      &gt;&gt; infinispan-dev mailing list<br>
&gt;      &gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt;     &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt;      &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;      &gt;<br>
&gt;      &gt;<br>
&gt;      &gt;<br>
&gt;      &gt; _______________________________________________<br>
&gt;      &gt; infinispan-dev mailing list<br>
&gt;      &gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt;     &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt;      &gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;     _______________________________________________<br>
&gt;     infinispan-dev mailing list<br>
&gt;     <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt;     <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; infinispan-dev mailing list<br>
&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;<br>
<br>
--<br>
Tristan Tarrant<br>
Infinispan Lead<br>
JBoss, a division of Red Hat<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</blockquote></div></div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr"><p class="inbox-inbox-fullname-container" style="box-sizing:border-box;color:rgb(0,0,0);font-family:overpass,sans-serif;font-weight:bold;margin:0px;padding:0px;font-size:14px;text-transform:uppercase"><span class="inbox-inbox-firstname-container" style="box-sizing:border-box">SEBASTIAN</span><span class="inbox-inbox-Apple-converted-space"> </span><span class="inbox-inbox-lastname-container" style="box-sizing:border-box">ŁASKAWIEC</span></p><p class="inbox-inbox-position-container" style="box-sizing:border-box;color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:10px;margin:0px 0px 4px;text-transform:uppercase"><span class="inbox-inbox-position" style="box-sizing:border-box">INFINISPAN DEVELOPER</span></p><p class="inbox-inbox-legal-container" style="box-sizing:border-box;font-family:overpass,sans-serif;margin:0px;font-size:10px;color:rgb(153,153,153)"><a class="inbox-inbox-redhat-anchor" href="https://www.redhat.com/" target="_blank" style="box-sizing:border-box;color:rgb(0,136,206);margin:0px;text-decoration:none">Red Hat<span class="inbox-inbox-Apple-converted-space"> </span><span style="box-sizing:border-box">EMEA</span></a></p><table border="0" style="box-sizing:border-box;color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:medium"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"><td width="100px" style="box-sizing:border-box"><a href="https://red.ht/sig" style="box-sizing:border-box"><img width="90" height="auto" style="box-sizing: border-box;" src="https://www.redhat.com/files/brand/email/sig-redhat.png"></a></td></tr></tbody></table></div></div>