OpenSSL 3.x made the DH struct opaque. Replace direct dh->p/dh->g member access with DH_set0_pqg() behind a version guard so older OpenSSL (< 1.1.0) keeps the original code path.