Java Code Examples for javax.net.ssl.X509ExtendedTrustManager#checkServerTrusted()

The following examples show how to use javax.net.ssl.X509ExtendedTrustManager#checkServerTrusted() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TrustManagerProxyTest.java    From athenz with Apache License 2.0 5 votes vote down vote up
@Test
public void testTrustManagerProxyCheckServerTrusted(@Mocked X509ExtendedTrustManager mockedTrustManager) throws CertificateException {
    new Expectations() {{
        mockedTrustManager.checkServerTrusted((X509Certificate[]) any, "cert"); times = 1;
    }};

    TrustManagerProxy trustManagerProxy = new TrustManagerProxy(new TrustManager[]{mockedTrustManager});

    trustManagerProxy.checkServerTrusted(null, "cert");
}
 
Example 2
Source File: ExtensibleTrustManagerImpl.java    From openhab-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket)
        throws CertificateException {
    X509ExtendedTrustManager linkedTrustManager = getLinkedTrustMananger(chain);
    if (linkedTrustManager == null) {
        logger.trace("No specific trust manager found, falling back to default");
        defaultTrustManager.checkServerTrusted(chain, authType, socket);
    } else {
        linkedTrustManager.checkServerTrusted(chain, authType, socket);
    }
}
 
Example 3
Source File: ExtensibleTrustManagerImpl.java    From openhab-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine sslEngine)
        throws CertificateException {
    X509ExtendedTrustManager linkedTrustManager = getLinkedTrustMananger(chain, sslEngine);
    if (linkedTrustManager == null) {
        logger.trace("No specific trust manager found, falling back to default");
        defaultTrustManager.checkServerTrusted(chain, authType, sslEngine);
    } else {
        linkedTrustManager.checkServerTrusted(chain, authType, sslEngine);
    }
}
 
Example 4
Source File: ExtensibleTrustManagerImpl.java    From smarthome with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket)
        throws CertificateException {
    X509ExtendedTrustManager linkedTrustManager = getLinkedTrustMananger(chain);
    if (linkedTrustManager == null) {
        logger.trace("No specific trust manager found, falling back to default");
        defaultTrustManager.checkServerTrusted(chain, authType, socket);
    } else {
        linkedTrustManager.checkServerTrusted(chain, authType, socket);
    }
}
 
Example 5
Source File: ExtensibleTrustManagerImpl.java    From smarthome with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine sslEngine)
        throws CertificateException {
    X509ExtendedTrustManager linkedTrustManager = getLinkedTrustMananger(chain, sslEngine);
    if (linkedTrustManager == null) {
        logger.trace("No specific trust manager found, falling back to default");
        defaultTrustManager.checkServerTrusted(chain, authType, sslEngine);
    } else {
        linkedTrustManager.checkServerTrusted(chain, authType, sslEngine);
    }
}