'What HTTP code do you get if an SSL has expired?

I have a custom monitor code setup. I need to check if the specified URL has its SSL certificate expired. Is there a specific HTTP code for this? For example:

(async() => {
    const res = await fetch('http://example.com');
    // Or `statusText`
    if (res.status == some_ssl_expiryCode) {
        console.log('SSL expired!');
    }
})();

Is there a way to do this in javascript?

Thank you.



Solution 1:[1]

The client application receives an HTTP 400 - Bad request response with the message "The SSL certificate error".

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 devnet