Code example for SSLPeerUnverifiedException

0
        return 12345; 
    } 
     
    public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException {
        if (certs == null) {
            throw new SSLPeerUnverifiedException("peer not authenticated");
        } else { 
            return certs;
        } 
    } 
     
    public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException {
        if(xCerts == null) {
            throw new SSLPeerUnverifiedException("peer not authenticated");
        } else { 
            return xCerts;
        } 
    } 
     
    public String getPeerHost() {
        return nameHost;