<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/SSL+Client+Connections">SSL Client Connections</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~rareddy">Ramesh Reddy</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br># <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;"># The key alias(not required, if given named certificate is used) <br># <br> <br>#org.teiid.ssl.keyAlias= <br> <br># <br></td></tr>
            <tr><td class="diff-unchanged" ># The classpath or filesystem location of the <br># trust store. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>This chapter will shows you various security configurations that can be used with Teiid in securing your data access. Note that data level security called as "data roles" are explained in Reference Guide. This chapter pertains to transport level security.</p>

<h1><a name="SSLClientConnections-EncryptionModes"></a>Encryption Modes</h1>

<p>Teiid supports couple different levels Encryption based on the <em>"mode"</em> attribute on <em>"ssl"</em> element which is part of <em>"tranport"</em> configuration in the Teiid subsystem in <em>&lt;jboss-install&gt;/standalone/configuration/standalone-teiid.xml</em> file.</p>

<ul>
        <li><b>logIn</b> &#45; (non-data) messages between client and server are encrypted using a <a href="http://en.wikipedia.org/wiki/Diffie-Hellman_key_exchange" class="external-link" rel="nofollow">Diffy-Hellman</a> key that is negotiated per connection. This is default setting for JDBC connections that use "teiid" transport.</li>
</ul>


<ul>
        <li><b>enabled</b> &#45; Mode to enable certificate based SSL</li>
</ul>


<ul>
        <li><b>disabled</b> &#45; turn off any kind of encryption.</li>
</ul>



<h1><a name="SSLClientConnections-SSLAuthenticationModes"></a>SSL Authentication Modes</h1>

<p>Teiid supports SSL based channel between the client JDBC application and Teiid Server. Teiid supports the following SSL modes.</p>

<ul>
        <li><b>Anonymous</b> &#8211; No certificates are required, but all communications are still encrypted using the TLS_DH_anon_WITH_AES_128_CBC_SHA SSL suite.</li>
</ul>


<ul>
        <li><b>1-way</b> &#8211; Only authenticates the server to the client traffic.  Requires a private key keystore to be created for the server and a truststore at the client that authenticates that key.  The SSL suite is negotiated.</li>
</ul>


<ul>
        <li><b>2-way</b> &#8211; Mutual client and server authentication. The server and client applications each have a keystore for their private keys and each has a truststore that authenticates the other.<br/>
Depending upon the SSL mode, follow the guidelines of your organization around creating/obtaining private keys.  If you have no organizational requirements, then follow this guide to create self-signed certificates with their respective keystores and truststores.</li>
</ul>


<p>The following keystore and truststore combinations are required for different SSL modes. The names of the files can be chosen by the user. The following files are shown for example purposes only.</p>

<p><em>1-way</em></p>

<ol>
        <li>server.keystore - has server's private key</li>
        <li>server.truststore - has server's public key</li>
</ol>


<p><em>2-way</em></p>

<ol>
        <li>server.keystore - has server's private key</li>
        <li>server.truststore - has server's public key</li>
        <li>client.keystore - client's private key</li>
        <li>client.truststore - has client's public key</li>
</ol>


<h1><a name="SSLClientConnections-ClientSSLSettings"></a>Client SSL Settings</h1>

<p>The following sections define the properties required for each SSL mode. Note that when connecting to Teiid Server with SSL enabled, you <em>MUST</em> use the <em>"mms"</em> protocol, instead of "mm" in the JDBC connection URL, for example</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
jdbc:teiid:&lt;myVdb&gt;@_mms_://&lt;host&gt;:&lt;port&gt;
</pre>
</div></div>

<p>There are two different sets of properties that a client can configure to enable 1-way or 2-way SSL.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Generating Self Signed Certificate with Keytool</b><br />If you want to create a self signed keystore and truststore, you can check out these instructions <a href="https://community.jboss.org/docs/DOC-13901" class="external-link" rel="nofollow">https://community.jboss.org/docs/DOC-13901</a></td></tr></table></div>

<h3><a name="SSLClientConnections-Option1%3AJavaSSLproperties"></a>Option 1: Java SSL properties</h3>

<p>These are standard Java defined system properties to configure the SSL under any JVM, Teiid is not unique in its use of SSL. Provide the following system properties to the client VM process.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>1-way SSL</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">-Djavax.net.ssl.trustStore=&lt;dir&gt;/server.truststore (required)
-Djavax.net.ssl.trustStorePassword=&lt;password&gt; (optional)
-Djavax.net.ssl.keyStoreType (optional)</pre>
</div></div>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>2-way SSL</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">-Djavax.net.ssl.keyStore=&lt;dir&gt;/client.keystore (required)
-Djavax.net.ssl.keyStrorePassword=&lt;password&gt; (optional)
-Djavax.net.ssl.trustStore=&lt;dir&gt;/server.truststore (required)
-Djavax.net.ssl.trustStorePassword=&lt;password&gt; (optioanl)
-Djavax.net.ssl.keyStroreType=&lt;keystore type&gt; (optional)</pre>
</div></div>

<h3><a name="SSLClientConnections-Option2%3ATeiidSpecificProperties"></a>Option 2: Teiid Specific Properties</h3>

<p>Use this option for <em>anonymous</em> mode or when the above "javax" based properties are already in use by the host process. For example if your client application is a Tomcat process that is configured for https protocol and the above Java based properties are already in use, and importing Teiid-specific certificate keys into those https certificate keystores is not allowed.</p>

<p>In this scenario, a different set of Teiid-specific SSL properties can be set as system properties or defined inside the a "teiid-client-settings.properties" file. A sample "teiid-client-settings.properties" file can be found inside the "teiid-&lt;version&gt;<del>client.jar" file at the root called "teiid-client-settings.orig.properties". Extract this file, make a copy, change the property values required for the chosen SSL mode, and place this file in the client application's classpath before the "teiid</del>&lt;version&gt;-client.jar" file.</p>


<p>SSL properties and definitions that can be set in a "teiid-client-settings.properties" file are shown below.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
########################################
# SSL Settings
########################################

#
# The key store type.  Defaults to JKS
#

org.teiid.ssl.keyStoreType=JKS

#
# The key store algorithm, defaults to
# the system property "ssl.TrustManagerFactory.algorithm"
#

#org.teiid.ssl.algorithm=

#
# The classpath or filesystem location of the
# key store.
#
# This property is required only if performing 2-way
# authentication that requires a specific private
# key.
#

#org.teiid.ssl.keyStore=

#
# The key store password (not required)
#

#org.teiid.ssl.keyStorePassword=

#
# The key alias(not required, if given named certificate is used)
#

#org.teiid.ssl.keyAlias=

#
# The classpath or filesystem location of the
# trust store.
#
# This property is required if performing 1-way
# authentication that requires trust not provided
# by the system defaults.
#

#org.teiid.ssl.trustStore=

#
# The trust store password (not required)
#

#org.teiid.ssl.trustStorePassword=

#
# The cipher protocol, defaults to SSLv3
#

org.teiid.ssl.protocol=SSLv3

#
# Whether to allow anonymous SSL
# (the TLS_DH_anon_WITH_AES_128_CBC_SHA cipher suite)
# defaults to true
#

org.teiid.ssl.allowAnon=true
</pre>
</div></div>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>1-way SSL</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
org.teiid.ssl.trustStore=&lt;dir&gt;/server.truststore (required)
</pre>
</div></div>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>2-way SSL</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
org.teiid.ssl.keyStore=&lt;dir&gt;/client.keystore (required)
org.teiid.ssl.trustStore=&lt;dir&gt;/server.truststore (required)
</pre>
</div></div>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Anonymous</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
org.teiid.ssl.trustStore=NONE
</pre>
</div></div>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://docs.jboss.org/author/display/TEIID/SSL+Client+Connections">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=18646134&revisedVersion=7&originalVersion=6">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/SSL+Client+Connections?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>