HttpsURLConnection getLocalPrincipal - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for HttpsURLConnection getLocalPrincipal method.

This code example shows how to use the following methods:getCipherSuite, getLocalCertificates, getLocalPrincipal, getPeerPrincipal, getServerCertificates
This code example shows how to use the following methods:getLocalPrincipal
        } 
    } 
 
    public final void testGetLocalPrincipal() { 
        HttpsURLConnection con = new MyHttpsURLConnection(null);
        if (con.getLocalPrincipal() != null) {
            fail("Non null result");
        } 
    } 
 
    public final void testSetDefaultHostnameVerifier() { 
        try { 
            HttpsURLConnection.setDefaultHostnameVerifier(null);
            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        } 
    } 
 
    public final void testSetHostnameVerifier() { 
        HttpsURLConnection con = new MyHttpsURLConnection(null);
4
CodeRank
This code example shows how to use the following methods:getLocalPrincipal
        } 
    } 
 
    public final void testGetLocalPrincipal() { 
        HttpsURLConnection con = new MyHttpsURLConnection(null);
        if (con.getLocalPrincipal() != null) {
            fail("Non null result");
        } 
    } 
 
    public final void testSetDefaultHostnameVerifier() { 
        try { 
            HttpsURLConnection.setDefaultHostnameVerifier(null);
            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        } 
    } 
 
    public final void testSetHostnameVerifier() { 
        HttpsURLConnection con = new MyHttpsURLConnection(null);
4
CodeRank
This code example shows how to use the following methods:getLocalPrincipal
		return realConnection.getLocalCertificates();
	} 
	 
	public Principal getLocalPrincipal()
	{ 
		return realConnection.getLocalPrincipal();
	} 
	 
	public Principal getPeerPrincipal() throws SSLPeerUnverifiedException
	{ 
		return realConnection.getPeerPrincipal();
	} 
	 
	public SSLSocketFactory getSSLSocketFactory()
	{ 
		return realConnection.getSSLSocketFactory();
	} 
	 
	public Certificate[] getServerCertificates() throws SSLPeerUnverifiedException
	{ 
4
CodeRank
This code example shows how to use the following methods:setDoOutput, getCipherSuite, getLocalCertificates, getLocalPrincipal, getPeerPrincipal
            URL url = new URL("https://requested.host:55554/requested.data");
            HttpsURLConnection connection = (HttpsURLConnection) url
                    .openConnection(new Proxy(Proxy.Type.HTTP,
                            new InetSocketAddress("localhost", ss
                                    .getLocalPort())));
            connection.setDoOutput(true);
 
            // perform the interaction between the peers and check the results 
            SSLSocket peerSocket = (SSLSocket) doInteraction(connection, ss,
                    OK_CODE);
            checkConnectionStateParameters(connection, peerSocket);
        } finally { 
            // roll the properties back to system values 
            tearDownStoreProperties(); 
        } 
    } 
 
    /** 
     * Tests HTTPS connection process made through the proxy server. Proxy 
     * server needs authentication but client fails to authenticate 

4
CodeRank
getLocalPrincipal Method Overview
Returns the Principal used to identify the local host during the handshake.
See Code Examples for other Java 8 HttpsURLConnection Methods: