import { PeerCertificate } from "tls" ; export default function checkServerIdentity ( host , cert ) { const { subject : { CN } } = cert ; const re = /^(([a-zA-Z0-9]+-[a-zA-Z0-9]+)|legacy-terminal-certificate)\.(live|test)\.terminal\.adyen\.com$/ ; const isValid = re . test ( CN ) ; const error = new Error ( "Couldn't verify certificate" ) ; return isValid ? undefined : error ; }