title: Upgrade OpenSSL on Docker php:7.2-apache to connect to smtp.gmail
body: <p>Using the official Docker php:7.2-apache image, we moved our Symfony 4.2 application to containers.<br/>
  We then had a first problem with (seemingly) OpenSsl with our Database Connection (SQL Server ODBC 17).<br/></p>
  <pre><code>SQLSTATE [08001, 10054]: [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x2746
  SQLSTATE [08001, 10054]: [Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection
  </code></pre>
  <p>Our original server runned on Ubuntu 20.04 with Openssl 1.1.1f for PHP and the Docker image is on Debian 10 with Openssl 1.1.1d 2019 (installed by default).<br/>
  So I installed the 1.1.1f version manually ( since the last stable avalaible on the package repo is 1.1.1d )</p>
  <pre><code>RUN rm /usr/bin/openssl
  RUN cd /usr/local/src &amp;&amp; wget https://www.openssl.org/source/openssl-1.1.1f.tar.gz &amp;&amp; tar -xf openssl-1.1.1f.tar.gz
  RUN cd /usr/local/src/openssl-1.1.1f &amp;&amp; ./config &amp;&amp; make &amp;&amp; make install
  RUN ln -s /usr/local/bin/openssl /usr/bin/openssl &amp;&amp; ldconfig
  </code></pre>
  <p>And the connection to the Database worked <strong>BUT</strong> we now can't connect SwiftMailer to our gmail account.</p>
  <pre><code>Swift_TransportException: Connecn could not be established with host smtp.gmail.com :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed 
  </code></pre>
  <p>This gmail connection worked with OpenSSL 1.1.1d - so I checked and discovered that PHP still use the 1.1.1d as the Header library</p>
  <pre><code>OpenSSL support =&gt; enabled
  OpenSSL Library Version =&gt; OpenSSL 1.1.1f  2020
  OpenSSL Header Version =&gt; OpenSSL 1.1.1d  2019
  </code></pre>
  <p>So my thoughts and questions, about OpenSSL :</p>
  <ul>
  <li>I've found that to update the Header however, PHP must be recompilled
  and using the officiel Docker php:7.2-apache image, I am not sure how
  to proceed ( or if it is even a good idea to begin with). How should I proceed ?</li>
  <li>I am not sure it is due to this problem and will try with a more recent
  version of the library - 1.1.1i ( or newer )</li>
  <li>I might,as a last resort, change my base image to ubuntu:20.04 and manually install PHP but I feel like it might be Overkill - and would cost lot of time. Would that be worth it ?</li>
  </ul>
  <p>Both email and database connection must works.</p>