<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/Configuring+Teiid+Server+SSL">Configuring Teiid Server SSL</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~shawkins">Steven Hawkins</a>
    </h4>
        <br/>
                         <h4>Changes (10)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Teiid can have multiple transports defined for access.&amp;nbsp; A transport contains properties to configure SSL. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1. Encryption Modes <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Teiid supports a couple different levels Encryption based on the _&quot;mode&quot;_ attribute on _&quot;ssl&quot;_ element which is part of _&quot;transport&quot;_ configuration in the Teiid subsystem. <br> <br>* *logIn* \- (non-data) messages between client and server are encrypted using a [Diffy-Hellman|http://en.wikipedia.org/wiki/Diffie-Hellman_key_exchange] key that is negotiated per connection. This is default setting for JDBC connections that use &quot;teiid&quot; transport. <br> <br>* *enabled* \- Mode to enable certificate based SSL <br> <br>* *disabled* \- turns off any kind of encryption <br> <br>h1. SSL Authentication Modes <br> <br>* *anonymous* -- No certificates are required, but all communications are still encrypted using the TLS_DH_anon_WITH_AES_128_CBC_SHA SSL suite. In most secure intranet environments, anonymous is suitable to just bulk encrypt traffic without the need to setup SSL certificates. No certificates are exchanged, settings are not needed for the keystore and truststore properties. Clients must have {{org.teiid.ssl.allowAnon}} set to true (the default) to connect to an anonymous server. <br> <br>* *1-way* -- Only authenticates the server to the client.  Requires a private key keystore to be created for the server and a truststore at the client that authenticates that certificate.   <br> <br>* *2-way* -- 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. The server will present a certificate, which is obtained from the keystore related properties. The client should have a truststore configured to accept the server certificate.  The client is  also expected to present a certificate, which is obtained from its keystore.  The client certificate should be accepted by the trust store configured by the truststore related properties. <br> <br>For non-anonymous SSL, the suite is negotiated - see _enabled\-cipher\-suites_ below below. <br> <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|Generating Self Signed Certificate with Keytool] with their respective keystores and truststores. 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.  <br> <br>_1-way_ <br> <br># server.keystore - has server&#39;s private key <br># server.truststore - has server&#39;s public key <br> <br>_2-way_ <br> <br># server.keystore - has server&#39;s private key <br># server.truststore - has server&#39;s public key <br># client.keystore - client&#39;s private key <br># client.truststore - has client&#39;s public key <br> <br>h1. Full Configuration Options <br> <br></td></tr>
            <tr><td class="diff-unchanged" >There are two types of remote transports, each with it&#39;s own SSL configuration: <br>* &quot;teiid&quot; - Defaults to only encrypt login traffic, in which none of the other properties are used. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>Properties <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-changed-words"><span class="diff-added-chars"style="background-color: #dfd;">[</span>mode<span class="diff-added-chars"style="background-color: #dfd;">|#Encryption Modes]</span></span> - diabled\|login\|enabled <br></td></tr>
            <tr><td class="diff-unchanged" > _disabled_ = no transport or message level security will be used. <br> _login_ = only the login traffic will be encrypted at a message  level using 128 bit AES with an ephemeral DH key exchange. Only applies  to the &#39;teiid&#39; transport and no other config values are needed in this  mode. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >* keystore/type - Keystore type created by the keytool. Default &quot;JKS&quot; is used. <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-changed-words"><span class="diff-added-chars"style="background-color: #dfd;">[</span>authentication-mode<span class="diff-added-chars"style="background-color: #dfd;">|#SSL Authentication Modes]</span></span> - anonymous\|1-way\|2-way,  Type of SSL Authentication Mode. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>* keymanagement-algorithm - Type of key algorithm used. Default is based upon the VM, i.e. &quot;SunX509&quot; <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{note} <br>{info:Using password Vault} <br></td></tr>
            <tr><td class="diff-changed-lines" >If  you do not like to leave clear text passwords in the configuration  file, then you can use JBoss AS vault mechanism for storing the keystore <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;"> </span> and truststore passwords. Use the directions defined here [https://community.jboss.org/docs/DOC-17248|https://community.jboss.org/docs/DOC-17248] <br></td></tr>
            <tr><td class="diff-unchanged" >{info} <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h1. SSL Authentication Modes <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">SSL supports multiple authentication modes.  In most secure intranet  environments, anonymous is suitable to just bulk encrypt traffic without  the need to setup SSL certificates. <br>* _anonymous_\- no certificates are exchanged, settings are not needed for the keystore and truststore properties. Client must have {{org.teiid.ssl.allowAnon}} set to true (the default) to connect to an anonymous server. <br> <br>* _1-way_\- the server will present a certificate, which is  obtained from the keystore related properties. The client should have a  truststore configured to accept the server certificate. <br> <br>* _2-way_\- the server will present a certificate, which is  obtained from the keystore related properties. The client should have a  truststore configured to accept the server certificate.  The client is  also expected to present a certificate, which is obtained from its  keystore.  The client certificate should be accepted by the trust store  configured by the truststore related properties. <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h1. Encryption Strength <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Both anonymous SSL and login only encryption are configured to use  128 bit AES encryption by default.  By default, 1-way and 2-way SSL  allow for cipher suite negotiation based upon the default cipher suites  supported by the respective Java platforms of the client and server.  User can restrict the cipher suites used for encryption by specifying  the _enabledCipherSuites_ property above in ssl configuration. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Both anonymous SSL and login only encryption are configured to use 128 bit AES encryption by default.  By default 1-way and 2-way SSL allow for cipher suite negotiation based upon the default cipher suites supported by the respective Java platforms of the client and server.  Users can restrict the cipher suites used by specifying the _enabled\-cipher\-suites_ property above in the SSL configuration. <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="ConfiguringTeiidServerSSL-EncryptionModes"></a>Encryption Modes</h1>

<p>Teiid supports a couple different levels Encryption based on the <em>"mode"</em> attribute on <em>"ssl"</em> element which is part of <em>"transport"</em> configuration in the Teiid subsystem.</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; turns off any kind of encryption</li>
</ul>


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

<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. In most secure intranet environments, anonymous is suitable to just bulk encrypt traffic without the need to setup SSL certificates. No certificates are exchanged, settings are not needed for the keystore and truststore properties. Clients must have <tt>org.teiid.ssl.allowAnon</tt> set to true (the default) to connect to an anonymous server.</li>
</ul>


<ul>
        <li><b>1-way</b> &#8211; Only authenticates the server to the client.  Requires a private key keystore to be created for the server and a truststore at the client that authenticates that certificate.</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. The server will present a certificate, which is obtained from the keystore related properties. The client should have a truststore configured to accept the server certificate.  The client is  also expected to present a certificate, which is obtained from its keystore.  The client certificate should be accepted by the trust store configured by the truststore related properties.</li>
</ul>


<p>For non-anonymous SSL, the suite is negotiated - see <em>enabled&#45;cipher&#45;suites</em> below below.</p>

<p>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 <a href="/author/display/TEIID/Generating+Self+Signed+Certificate+with+Keytool" title="Generating Self Signed Certificate with Keytool">self-signed certificates</a> with their respective keystores and truststores. 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="ConfiguringTeiidServerSSL-FullConfigurationOptions"></a>Full Configuration Options</h1>

<p>There are two types of remote transports, each with it's own SSL configuration:</p>
<ul>
        <li>"teiid" - Defaults to only encrypt login traffic, in which none of the other properties are used.</li>
        <li>"pg" - Defaults to no SSL
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>The pg transport for ODBC access defaults to clear text username password authentication</td></tr></table></div></li>
</ul>


<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Example XML Configuration</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: xml; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
&lt;ssl mode="enabled" authentication-mode="1-way" ssl-protocol="SSLv3" keymanagement-algorithm="algo"
         enabled-cipher-suites="SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_RC4_128_SHA"&gt;
            &lt;keystore name="cert.keystore" password="passwd" type="JKS" key-alias="alias"/&gt;
            &lt;truststore name="cert.truststore" password="passwd"/&gt;
&lt;/ssl&gt;
</pre>
</div></div>

<p>Properties</p>
<ul>
        <li><a href="#ConfiguringTeiidServerSSL-EncryptionModes">mode</a> - diabled&#124;login&#124;enabled<br/>
 <em>disabled</em> = no transport or message level security will be used.<br/>
 <em>login</em> = only the login traffic will be encrypted at a message  level using 128 bit AES with an ephemeral DH key exchange. Only applies  to the 'teiid' transport and no other config values are needed in this  mode.<br/>
 <em>enabled</em> = traffic will be secured with SSL using the other configuration properties.</li>
</ul>


<ul>
        <li>ssl-protocol&#45; Type of SSL protocol to be used. Default is TLSv1</li>
</ul>


<ul>
        <li>keystore/type - Keystore type created by the keytool. Default "JKS" is used.</li>
</ul>


<ul>
        <li><a href="#ConfiguringTeiidServerSSL-SSLAuthenticationModes">authentication-mode</a> - anonymous&#124;1-way&#124;2-way,  Type of SSL Authentication Mode.</li>
</ul>


<ul>
        <li>keymanagement-algorithm - Type of key algorithm used. Default is based upon the VM, i.e. "SunX509"</li>
</ul>


<ul>
        <li>keystore/name - The file name of the keystore, which contains the  private key of the Server. The file name can be relative resource path  available to the Teiid deployer classloader or an absolute file system  path. A typical installation would place the keystore file in the conf  directory of the profile where Teiid is deployed with a file name  relative to the conf path.</li>
</ul>


<ul>
        <li>keystorePassword - password for the keystore.</li>
</ul>


<ul>
        <li>keystore/key-alias - Alias name for the certificate that is in the key store.</li>
</ul>


<ul>
        <li>truststore/name - if "authenticationMode" is chosen as "2-way",  then this property must be provided. This is the truststore that  contains the public key for the client. Depending upon how you created  the keystore and truststores, this may be same file as defined under   "keystoreFilename" property.</li>
</ul>


<ul>
        <li>truststore/password - password for the truststore.</li>
</ul>


<ul>
        <li>enabled-cipher-suites - A comma separated list of cipher suites  allowed for encryption between server and client.  The values must be  valid supported cipher suites otherwise SSL connections will fail.</li>
</ul>


<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>You will typically use the CLI to modify the transport configuration.</td></tr></table></div>
<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>If  you do not like to leave clear text passwords in the configuration  file, then you can use JBoss AS vault mechanism for storing the keystore and truststore passwords. Use the directions defined here <a href="https://community.jboss.org/docs/DOC-17248" class="external-link" rel="nofollow">https://community.jboss.org/docs/DOC-17248</a></td></tr></table></div>


<h1><a name="ConfiguringTeiidServerSSL-EncryptionStrength"></a>Encryption Strength</h1>

<p>Both anonymous SSL and login only encryption are configured to use 128 bit AES encryption by default.  By default 1-way and 2-way SSL allow for cipher suite negotiation based upon the default cipher suites supported by the respective Java platforms of the client and server.  Users can restrict the cipher suites used by specifying the <em>enabled&#45;cipher&#45;suites</em> property above in the SSL configuration.</p>
    </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/Configuring+Teiid+Server+SSL">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=18646063&revisedVersion=17&originalVersion=16">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/Configuring+Teiid+Server+SSL?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>