

```bash
$ curl -w %{certs} https://nextcloud.photos-nas.ovh/ --silent -o /dev/null | grep -Ei "^(start|expire) date:" | head -n 2
Start date:Jul 10 14:55:12 2024 GMT
Expire date:Oct  8 14:55:11 2024 GMT

# Issuer:C = US, O = Let's Encrypt, CN = R10
# X509v3 Subject Alternative Name:DNS:*.photos-nas.ovh, DNS:photos-nas.ovh

```

```bash
$ curl --insecure -vvI https://nextcloud.photos-nas.ovh 2>&1 | grep "expire date" | awk '{print $4,$5,$6,$7,$8,$9}'
Oct 8 14:55:11 2024 GMT
```

```bash
$ nmap -p 443 --script ssl-cert nextcloud.photos-nas.ovh
Starting Nmap 7.95 ( https://nmap.org ) at 2024-07-26 16:34 CEST
Nmap scan report for nextcloud.photos-nas.ovh (192.168.2.57)
Host is up (0.0030s latency).
rDNS record for 192.168.2.57: photos-nas.fr

PORT    STATE SERVICE
443/tcp open  https
| ssl-cert: Subject: commonName=photos-nas.ovh
| Subject Alternative Name: DNS:*.photos-nas.ovh, DNS:photos-nas.ovh
| Issuer: commonName=R10/organizationName=Let's Encrypt/countryName=US
| Public Key type: rsa
| Public Key bits: 4096
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2024-07-10T14:55:12
| Not valid after:  2024-10-08T14:55:11
| MD5:   2051:3683:b6ef:060e:073b:58c9:ea6d:4c48
|_SHA-1: 4abc:421e:08eb:fd29:8c9e:5ed2:1510:422f:aea4:2100

Nmap done: 1 IP address (1 host up) scanned in 0.13 seconds

```

```bash
$ showcert nextcloud.photos-nas.ovh
IP: 192.168.2.57
Names: photos-nas.ovh *.photos-nas.ovh
notBefore: 2024-07-10 14:55:12 (16 days old)
notAfter: 2024-10-08 14:55:11 (73 days left)
Issuer: C=US O=Let's Encrypt CN=R10
Tags: [CHAIN-VERIFIED]

```

```bash
$ echo | openssl s_client -connect nextcloud.photos-nas.ovh:443 2>/dev/null | openssl x509 -noout -enddate
notAfter=Oct  8 14:55:11 2024 GMT

ssl_expiry () {
  echo | openssl s_client -connect ${1}:443 2> /dev/null | openssl x509 -noout -enddate
}


❯ echo | openssl s_client -connect nextcloud.photos-nas.ovh:443 2>/dev/null | openssl x509 -noout -dates -issuer -subject
notBefore=Jul 10 14:55:12 2024 GMT
notAfter=Oct  8 14:55:11 2024 GMT
issuer=C=US, O=Let's Encrypt, CN=R10
subject=CN=photos-nas.ovh

```

```bash
❯ keytool -printcert -sslserver nextcloud.photos-nas.ovh:443
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

```

```bash
❯ openssl s_client -showcerts -connect nextcloud.photos-nas.ovh:443
Connecting to 192.168.2.57
CONNECTED(00000005)
depth=2 C=US, O=Internet Security Research Group, CN=ISRG Root X1
verify return:1
depth=1 C=US, O=Let's Encrypt, CN=R10
verify return:1
depth=0 CN=photos-nas.ovh
verify return:1
---
Certificate chain
 0 s:CN=photos-nas.ovh
   i:C=US, O=Let's Encrypt, CN=R10
   a:PKEY: rsaEncryption, 4096 (bit); sigalg: RSA-SHA256
   v:NotBefore: Jul 10 14:55:12 2024 GMT; NotAfter: Oct  8 14:55:11 2024 GMT
-----BEGIN CERTIFICATE-----
.../...
```

