<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="source-ssl-library-configuration">
      </a>
      2.8.6 Configuring SSL Library Support
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045329404896">
  </a>
  <a class="indexterm" name="idm46045329403408">
  </a>
  <p>
   An SSL library is required for support of encrypted connections,
      entropy for random number generation, and other encryption-related
      operations.
  </p>
  <p>
   If you compile MySQL from a source distribution,
   <span class="command">
    <strong>
     CMake
    </strong>
   </span>
   configures the distribution to use the
      installed OpenSSL library by default.
  </p>
  <p>
   To compile using OpenSSL, use this procedure:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Ensure that OpenSSL 1.0.1 or newer is installed on your
          system. If the installed OpenSSL version is older than 1.0.1,
      <span class="command">
       <strong>
        CMake
       </strong>
      </span>
      produces an error at MySQL
          configuration time. If it is necessary to obtain OpenSSL,
          visit
      <a class="ulink" href="http://www.openssl.org" target="_blank">
       http://www.openssl.org
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      The
      <a class="link" href="source-configuration-options.html#option_cmake_with_ssl">
       <code class="option">
        WITH_SSL
       </code>
      </a>
      <span class="command">
       <strong>
        CMake
       </strong>
      </span>
      option determines which SSL library
          to use for compiling MySQL (see
      <a class="xref" href="source-configuration-options.html" title="2.8.7 MySQL Source-Configuration Options">
       Section 2.8.7, “MySQL Source-Configuration Options”
      </a>
      ). The default
          is
      <a class="link" href="source-configuration-options.html#option_cmake_with_ssl">
       <code class="option">
        -DWITH_SSL=system
       </code>
      </a>
      , which uses
          OpenSSL. To make this explicit, specify that option. For
          example:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa1980377"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal">cmake <span class="token punctuation">.</span> <span class="token constant">-DWITH_SSL</span><span class="token attr-value"><span class="token punctuation">=</span>system</span></code></pre>
     </div>
     <p>
      That command configures the distribution to use the installed
          OpenSSL library. Alternatively, to explicitly specify the path
          name to the OpenSSL installation, use the following syntax.
          This can be useful if you have multiple versions of OpenSSL
          installed, to prevent
      <span class="command">
       <strong>
        CMake
       </strong>
      </span>
      from choosing
          the wrong one:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa66585106"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal">cmake <span class="token punctuation">.</span> <span class="token constant">-DWITH_SSL</span><span class="token attr-value"><span class="token punctuation">=</span><em class="replaceable">path_name</em></span></code></pre>
     </div>
     <p>
      Alternative OpenSSL system packages are supported by using
      <code class="option">
       WITH_SSL=openssl11
      </code>
      on EL7 or
      <code class="option">
       WITH_SSL=openssl3
      </code>
      on EL8. Authentication
          plugins, such as LDAP and Kerberos, are disabled since they do
          not support these alternative versions of OpenSSL.
     </p>
    </li>
    <li class="listitem">
     <p>
      Compile and install the distribution.
     </p>
    </li>
   </ol>
  </div>
  <p>
   To check whether a
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   server supports
      encrypted connections, examine the value of the
   <a class="link" href="server-system-variables.html#sysvar_tls_version">
    <code class="literal">
     tls_version
    </code>
   </a>
   system variable:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa39730916"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SHOW</span> <span class="token keyword">VARIABLES</span> <span class="token operator">LIKE</span> <span class="token string">'tls_version'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Variable_name <span class="token punctuation">|</span> Value           <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> tls_version   <span class="token punctuation">|</span> TLSv1.2,TLSv1.3 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
  </div>
  <p>
   If the value contains TLS versions then the server supports
      encrypted connections, otherwise it does not.
  </p>
  <p>
   For additional information, see
   <a class="xref" href="using-encrypted-connections.html" title="8.3.1 Configuring MySQL to Use Encrypted Connections">
    Section 8.3.1, “Configuring MySQL to Use Encrypted Connections”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
