def verify_callback(_, cert)
            pem = cert.current_cert.public_key.to_pem
            sha256 = OpenSSL::Digest::SHA256.new
            hash = sha256.digest(pem).unpack("H*")

            hash[0].casecmp(@hash).zero?
        end
def verify_callback(_, cert)
            pem = cert.current_cert.public_key.to_pem
            sha256 = OpenSSL::Digest::SHA256.new
            hash = sha256.digest(pem).unpack("H*")

            hash[0].casecmp(@hash).zero?
        end
Connect to the server
 OpenSSL verify callback used by initialize when optional callback argument isn't set.