I have a server using openssl and I sent a connect request using openssl as:
openssl s_client -4 -connect www.google.com:443 -sigalgs rsa_pss_rsae_sha384 -tls1_2
I expected the connection to fail with cipher mismatch error, but instead the server chooses a SHA384 cipher and then sends a cert with RSA2K key signed using SHA256 algorithm. Why is the server/client not rejecting the connection? Are SHA384 and SHA256 inter-usable?
Certificate chain
0 s:CN = www.google.com, O = Example Inc., OU = Example Inc.
i:C = IN, L = ben, ST = kar, O = pqr, OU = pqs, CN = "rsa2k (t) "
a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256
v:NotBefore: Aug 26 14:26:13 2025 GMT; NotAfter: Sep 9 05:32:04 2025 GMT
1 s:C = IN, L = ben, ST = kar, O = pqr, OU = pqs, CN = "rsa2k (t) "
i:C = IN, ST = kar, L = ben, O = pqr, OU = pqs, CN = rsa2k
a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256
v:NotBefore: Aug 26 05:32:04 2025 GMT; NotAfter: Sep 9 05:32:04 2025 GMT
2 s:C = IN, ST = kar, L = ben, O = pqr, OU = pqs, CN = rsa2k
i:O = example.com, CN = Example Root CA
a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256
v:NotBefore: Aug 19 07:17:41 2025 GMT; NotAfter: Jan 4 07:17:41 2053 GMT
-------------------------skip-------------------------
Peer signing digest: SHA384
Peer signature type: RSA-PSS
Server Temp Key: ECDH, prime256v1, 256 bits
---
SSL handshake has read 3908 bytes and written 285 bytes
Verification: OK
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES256-GCM-SHA384