Nextcloud 24.0.1 openssl wrong version

if you do sudo openssl s_client -connect -tls1_2 it will give you the following message:

40B7C293337F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:…/ssl/record/ssl3_record.c:354:

no peer certificate available

No client certificate CA names sent

SSL handshake has read 5 bytes and written 216 bytes
Verification: OK

New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Protocol : TLSv1.2
Cipher : 0000
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1653394363
Timeout : 7200 (sec)
Verify return code: 0 (ok)
Extended master secret: no

When you do a basic setting and if you use and if you set the startls port to 587, you would have an openssl error that said something like wrong version (the same as the above example). The solution is to set to port 465 the problem will go away.