title: axios SSL error with Node 12 : SSL routines:ssl_choose_client_version:unsupported protocol
body: <p>I’m running into an issue with <code>axios</code> and Node 12. As I’m not sure this error is only related to <code>axios</code>, I followed the advice to ask on SO rather than opening a bug on axios’ GitHub.</p>
  
  <p>Here is the code I’m trying to run :</p>
  
  <pre class="lang-js prettyprint-override"><code>const axios = require('axios')
  
  axios({
    method: 'get',
    url: 'https://www.colisprive.com/moncolis/pages/detailColis.aspx?numColis=12345',
    responseType: 'text'
  }).then((response) =&gt; {
    console.log(response)
  })
  </code></pre>
  
  <p>This code fails on Node 12 with following error :</p>
  
  <pre><code>Error: write EPROTO 140121214769024:error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol:../deps/openssl/openssl/ssl/statem/statem_lib.c:1929:
  
      at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:87:16)
  </code></pre>
  
  <p><strong>Same code ran against Node 11 doesn’t throw any error.</strong></p>
  
  <p>When I <code>curl -v</code> I got this :</p>
  
  <pre><code>*   Trying 91.208.224.32:443...
  * TCP_NODELAY set
  * Connected to www.colisprive.com (91.208.224.32) port 443 (#0)
  * ALPN, offering h2
  * ALPN, offering http/1.1
  * successfully set certificate verify locations:
  *   CAfile: none
    CApath: /etc/ssl/certs
  * TLSv1.3 (OUT), TLS handshake, Client hello (1):
  * TLSv1.3 (IN), TLS handshake, Server hello (2):
  * TLSv1.2 (IN), TLS handshake, Certificate (11):
  * TLSv1.2 (IN), TLS handshake, Server key exchange (12):
  * TLSv1.2 (IN), TLS handshake, Server finished (14):
  * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
  * TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
  * TLSv1.2 (OUT), TLS handshake, Finished (20):
  * TLSv1.2 (IN), TLS handshake, Finished (20):
  * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-SHA384
  * ALPN, server did not agree to a protocol
  * Server certificate:
  *  subject: serialNumber=391029345; jurisdictionC=FR; businessCategory=Private Organization; C=FR; postalCode=13290; ST=Bouches-du-Rh�ne; L=AIX EN PROVENCE; street=1330 AV J R G GAUTIER DE LA LAUZIERE; street=ZI MILLES EUROPARC PICHAURY; O=COLIS PRIVE SAS; OU=0002 391029345; CN=www.colisprive.com
  *  start date: Sep  3 00:00:00 2018 GMT
  *  expire date: Sep  2 23:59:59 2020 GMT
  *  subjectAltName: host "www.colisprive.com" matched cert's "www.colisprive.com"
  *  issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO RSA Extended Validation Secure Server CA
  *  SSL certificate verify ok.
  &gt; GET /moncolis/pages/detailColis.aspx?numColis=12345 HTTP/1.1
  &gt; Host: www.colisprive.com
  &gt; User-Agent: curl/7.65.3
  &gt; Accept: */*
  &gt; 
  * Mark bundle as not supporting multiuse
  &lt; HTTP/1.1 302 Found
  &lt; Cache-Control: private
  &lt; Content-Type: text/html; charset=utf-8
  &lt; Location: /moncolis/Default.aspx?numColis=12345&amp;cp=
  &lt; Server: Microsoft-IIS/7.5
  &lt; Set-Cookie: ASP.NET_SessionId=eln3cq143d35lfj5tpqkkwcg; path=/; HttpOnly
  &lt; X-Powered-By: Colis Priv�
  &lt; Date: Fri, 24 Jan 2020 13:48:35 GMT
  &lt; Content-Length: 162
  &lt; 
  &lt;html&gt;&lt;head&gt;&lt;title&gt;Object moved&lt;/title&gt;&lt;/head&gt;&lt;body&gt;
  &lt;h2&gt;Object moved to &lt;a href="/moncolis/Default.aspx?numColis=12345&amp;amp;cp="&gt;here&lt;/a&gt;.&lt;/h2&gt;
  &lt;/body&gt;&lt;/html&gt;
  * Connection #0 to host www.colisprive.com left intact
  </code></pre>
  
  <p>As you can see, it gives a <code>302 Found</code> with a <code>Location</code> header pointing to another endpoint. I agree it should answer a <code>301 Moved</code> to indicate document has moved, but this is not the case and it is handled as expected by <code>axios</code> on Node 11 (fetching endpoint under <code>Location</code> header).</p>
  
  <p>I saw that Node 12 now includes TLS 1.3 as default, so this could be related to that…</p>
  
  <p>Also, there is an unknown character in <code>X-Powered-By</code> header.</p>
  
  <p>I tried to :</p>
  
  <ul>
  <li>reproduce this issue with an <code>express</code> server always replying <code>302 Found</code> with same headers : works as expected</li>
  <li>fetch another <code>.aspx</code> web page with <code>axios</code> : works as expected</li>
  </ul>