Repository: axios
Issue: Axios rejects valid certificate in a TLS handshake on Windows only
Labels: state::triage

#### Describe the bug
On trying to access a HTTPS secured API endpoint in VPN "hidden" Web service Axios is rejecting the valid certificate chain only on Windows. See https://stackoverflow.com/questions/71295178/axios-https-certificate-expired-error-only-on-windows for more details

#### To Reproduce
Have a Let's Encrypt signed certificate configured for your HTTPS endpoint and try to access that endpoint within a VSCode extension running on a Windows machine using Axios 0.26.0 using the code below:

```typescript
export type Response<T> = {
    headers: unknown;
    content: T | undefined;
};

export class HttpClient {
    private readonly instance: AxiosInstance;

    constructor() {
        this.instance = axios.create();
    }

    async asyncGet<T>(url: string): Promise<Response<T>> {
        return this.instance.get<T>(url)
            .then(axiosResponse => {
               ...
            })
            .catch(error => {
                console.log(JSON.stringify(error));
                throw error;
            });
    }
...
}
```

#### Expected behavior
Call should return the content of that endpoint

#### Actual behavior
Request is decliened with this error:

```json
{
  "message": "certificate has expired",
  "name": "Error",
  "stack": "Error: certificate has expired\n\tat TLSSocket.onConnectSecure (_tls_wrap.js:1497:34)\n\tat TLSSocket.emit (events.js:315:20)\n\tat TLSSocket._finishInit (_tls_wrap.js:932:8)\n\tat TLSWrap.onhandshakedone (_tls_wrap.js:706:12)\n\tat TLSWrap.callbackTrampoline (internal/async_hooks.js:131:14)",
  "config": {
    "transitional": {
      "silentJSONParsing": true,
      "forcedJSONParsing": true,
      "clarifyTimeoutError": false
    },
    "transformRequest": [
      null
    ],
    "transformResponse": [
      null
    ],
    "timeout": 0,
    "xsrfCookieName": "XSRF-TOKEN",
    "xsrfHeaderName": "X-XSRF-TOKEN",
    "maxContentLength": -1,
    "maxBodyLength": -1,
    "headers": {
      "Accept": "application/json, text/plain, */*",
      "User-Agent": "axios/0.26.0"
    },
    "method": "get",
    "url": "https://some.endpoint.url"
  },
  "code": "CERT_HAS_EXPIRED",
  "status": null
}
```

#### Environment
 - Axios Version: 0.26.0
 - Node 16.14.0 and 17.6.0
 - OS: Windows 10 Home (10.0.19044 Build 19044)
 - Run inside VSCode extension

#### Additional context/Screenshots
See [StackOverflow Post](https://stackoverflow.com/questions/71295178/axios-https-certificate-expired-error-only-on-windows)

Connecting via `tls` works though:

```typescript
        const socket: TLSSocket = tls.connect(443, host, undefined, () => {
            console.log("Connected to " + host);
            console.log('TLS.connect', socket.authorized ? 'authorized' : 'unauthorized');
            console.log('Cipher: ' + JSON.stringify(socket.getCipher()));
            console.log('Protocol: ' + JSON.stringify(socket.getProtocol()));
            const peerCert: tls.DetailedPeerCertificate = socket.getPeerCertificate(true);
            console.log(`Peer-Cert ${JSON.stringify(peerCert.subject)} - valid from: ${peerCert ? peerCert.valid_from : 'invalid'} valid till: ${peerCert ? peerCert.valid_to : 'invalid'}`);
            const issuerCert = peerCert.issuerCertificate;
            console.log(`issuer-Cert ${JSON.stringify(issuerCert.subject)} - valid from: ${issuerCert ? issuerCert.valid_from : 'invalid'} valid till: ${issuerCert ? issuerCert.valid_to : 'invalid'}`);
            const rootCert = issuerCert.issuerCertificate;
            console.log(`root-Cert ${JSON.stringify(rootCert.subject)} - valid from: ${rootCert ? rootCert.valid_from : 'invalid'} valid till: ${rootCert ? rootCert.valid_to : 'invalid'}`);
        });
```

Output:

```console
Connected to ...
TLS.connect authorized
Cipher: {"name":"TLS_CHACHA20_POLY1305_SHA256","standardName":"TLS_CHACHA20_POLY1305_SHA256","version":"TLSv1/SSLv3"}
Protocol: "TLSv1.3"
Peer-Cert {"CN":"*..."} - valid from: Feb  1 08:18:23 2022 GMT valid till: May  2 08:18:22 2022 GMT
issuer-Cert {"C":"US","O":"Let's Encrypt","CN":"R3"} - valid from: Sep  4 00:00:00 2020 GMT valid till: Sep 15 16:00:00 2025 GMT
root-Cert {"C":"US","O":"Internet Security Research Group","CN":"ISRG Root X1"} - valid from: Jan 20 19:14:03 2021 GMT valid till: Sep 30 18:14:03 2024 GMT
```

Adding `https.globalAgent.options.rejectUnauthorized = false;` before initializing Axios within the constructor of the HttpClient class "solves " the issue by suppressing the failure, but the core problem remains: A valid certificate chain is rejected but only on Windows environments