private void handshake() throws IOException { if (handshakeComplete) return; doHandshake(); handshakeComplete = true; }
public Map getHeaderFields() { if (headerFields != null) return headerFields; try { handshake(); } catch (IOException ex) { } return getHeaderFields0(); }
private void doHandshake() throws IOException { connect(); try { int response = parseResponseCode(); if (response != HTTP_UNAUTHORIZED && response != HTTP_PROXY_AUTH) { return; Type1Message type1 = (Type1Message) attemptNegotiation(response); if (type1 == null) return; // no NTLM int attempt = 0; Base64.encode(type1.toByteArray())); response = parseResponseCode(); if (response != HTTP_UNAUTHORIZED && response != HTTP_PROXY_AUTH) { attemptNegotiation(response); if (type3 == null) return; connection.setRequestProperty(authProperty, authMethod + ' ' + response = parseResponseCode(); if (response != HTTP_UNAUTHORIZED && response != HTTP_PROXY_AUTH) { reconnect(); } else { break;
public int getContentLength() { try { handshake(); } catch (IOException ex) { } return connection.getContentLength(); }
List methods = (List) getHeaderFields0().get(authHeader); if (methods == null) return null; Iterator iterator = methods.iterator(); NtlmMessage message = (authorization != null) ? new Type2Message(Base64.decode(authorization)) : null; reconnect(); if (message == null) { message = new Type1Message(); if (!allowUserInteraction) return null; try { URL url = getURL(); String protocol = url.getProtocol(); int port = url.getPort();
protected URLConnection openConnection(URL url) throws IOException { url = new URL(url, url.toExternalForm(), getDefaultStreamHandler(url.getProtocol())); return new NtlmHttpURLConnection((HttpURLConnection) url.openConnection()); }
public OutputStream getOutputStream() throws IOException { try { connect(); } catch (IOException ex) { } OutputStream output = connection.getOutputStream(); cachedOutput = new ByteArrayOutputStream(); return new CacheStream(output, cachedOutput); }
private void doHandshake() throws IOException { connect(); try { int response = parseResponseCode(); if (response != HTTP_UNAUTHORIZED && response != HTTP_PROXY_AUTH) { return; Type1Message type1 = (Type1Message) attemptNegotiation(response); if (type1 == null) return; // no NTLM int attempt = 0; Base64.encode(type1.toByteArray())); response = parseResponseCode(); if (response != HTTP_UNAUTHORIZED && response != HTTP_PROXY_AUTH) { attemptNegotiation(response); if (type3 == null) return; connection.setRequestProperty(authProperty, authMethod + ' ' + response = parseResponseCode(); if (response != HTTP_UNAUTHORIZED && response != HTTP_PROXY_AUTH) { reconnect(); } else { break;
public long getLastModified() { try { handshake(); } catch (IOException ex) { } return connection.getLastModified(); }
List methods = (List) getHeaderFields0().get(authHeader); if (methods == null) return null; Iterator iterator = methods.iterator(); NtlmMessage message = (authorization != null) ? new Type2Message(Base64.decode(authorization)) : null; reconnect(); if (message == null) { message = new Type1Message(); if (!allowUserInteraction) return null; try { URL url = getURL(); String protocol = url.getProtocol(); int port = url.getPort();
@Override protected URLConnection openConnection ( URL url ) throws IOException { url = new URL(url, url.toExternalForm(), getDefaultStreamHandler(url.getProtocol())); return new NtlmHttpURLConnection((HttpURLConnection) url.openConnection(), this.transportContext); }
public OutputStream getOutputStream() throws IOException { try { connect(); } catch (IOException ex) { } OutputStream output = connection.getOutputStream(); cachedOutput = new ByteArrayOutputStream(); return new CacheStream(output, cachedOutput); }
private void doHandshake() throws IOException { connect(); try { int response = parseResponseCode(); if (response != HTTP_UNAUTHORIZED && response != HTTP_PROXY_AUTH) { return; Type1Message type1 = (Type1Message) attemptNegotiation(response); if (type1 == null) return; // no NTLM int attempt = 0; Base64.encode(type1.toByteArray())); response = parseResponseCode(); if (response != HTTP_UNAUTHORIZED && response != HTTP_PROXY_AUTH) { attemptNegotiation(response); if (type3 == null) return; connection.setRequestProperty(authProperty, authMethod + ' ' + response = parseResponseCode(); if (response != HTTP_UNAUTHORIZED && response != HTTP_PROXY_AUTH) { reconnect(); } else { break;
public String getContentEncoding() { try { handshake(); } catch (IOException ex) { } return connection.getContentEncoding(); }
List methods = (List) getHeaderFields0().get(authHeader); if (methods == null) return null; Iterator iterator = methods.iterator(); NtlmMessage message = (authorization != null) ? new Type2Message(Base64.decode(authorization)) : null; reconnect(); if (message == null) { message = new Type1Message(); if (!allowUserInteraction) return null; try { URL url = getURL(); String protocol = url.getProtocol(); int port = url.getPort();
public Map getHeaderFields() { if (headerFields != null) return headerFields; try { handshake(); } catch (IOException ex) { } return getHeaderFields0(); }
protected URLConnection openConnection(URL url) throws IOException { url = new URL(url, url.toExternalForm(), getDefaultStreamHandler(url.getProtocol())); return new NtlmHttpURLConnection((HttpURLConnection) url.openConnection()); }
public OutputStream getOutputStream() throws IOException { try { connect(); } catch (IOException ex) { } OutputStream output = connection.getOutputStream(); cachedOutput = new ByteArrayOutputStream(); return new CacheStream(output, cachedOutput); }
private void handshake() throws IOException { if (handshakeComplete) return; doHandshake(); handshakeComplete = true; }
private void doHandshake () throws IOException, GeneralSecurityException { connect(); try { int response = parseResponseCode(); if ( response != HTTP_UNAUTHORIZED && response != HTTP_PROXY_AUTH ) { return; NtlmMessage type1 = attemptNegotiation(response); if ( type1 == null ) return; // no NTLM this.connection.setRequestProperty(this.authProperty, this.authMethod + ' ' + Base64.toBase64String(type1.toByteArray())); this.connection.connect(); // send type 1 response = parseResponseCode(); if ( response != HTTP_UNAUTHORIZED && response != HTTP_PROXY_AUTH ) { return; NtlmMessage type3 = attemptNegotiation(response); if ( type3 == null ) return; output.flush(); response = parseResponseCode(); if ( response != HTTP_UNAUTHORIZED && response != HTTP_PROXY_AUTH ) { return; reconnect();