diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c new file mode 100644 index 98d02b6..dd4fab8 *** a/src/interfaces/libpq/fe-secure-openssl.c --- b/src/interfaces/libpq/fe-secure-openssl.c *************** verify_peer_name_matches_certificate(PGc *** 626,637 **** sk_GENERAL_NAME_free(peer_san); } /* ! * If there is no subjectAltName extension, check the Common Name. * ! * (Per RFC 2818 and RFC 6125, if the subjectAltName extension is present, * the CN must be ignored.) */ ! else { X509_NAME *subject_name; --- 626,637 ---- sk_GENERAL_NAME_free(peer_san); } /* ! * If there is no subjectAltName extension of type dNSName, check the Common Name. * ! * (Per RFC 2818 and RFC 6125, if the subjectAltName extension of type dNSName is present, * the CN must be ignored.) */ ! if (names_examined == 0) { X509_NAME *subject_name;