Advertisements

sun.net.www.protocol.http.NTLMAuthentication.setHeaders Can’t get a java program to talk through a squid proxy

Uncaught error fetching image:
java.lang.NullPointerException
at sun.net.www.protocol.http.NTLMAuthentication.setHeaders(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.doTunneling(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
at sun.awt.image.ImageFetcher.run(Unknown Source)
java.lang.RuntimeException: java.lang.NullPointerException
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at sun.net.www.protocol.http.NTLMAuthentication.setHeaders(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.doTunneling(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

As per this post http://www.mail-archive.com/squid-users@squid-cache.org/msg49361.html

added the following to
squid.conf

    acl Java browser Java/1.4 Java/1.5 Java/1.6
    http_access allow Java 

FYI
Henrik Nordstrom wrote:
> It's a workaround, allowing Java clients access without the need to
> authenticateto the proxy.

which means that whoever will put "Java/1.4" into browser's user
identification string, will be allowed to use proxy without authentication
Advertisements

Installing squid 2.7 windows to non defualt drive, installing squid 2.7 windows to d:\

Find this post interesting? Do you like interesting things? Maybe you would like my invention, a connectible candle called a WickBrick!

Get one here http://wickbrick.etsy.com/

WickBrick

Since Google seems to be coming here this is the link you really want for installing Squid on windows

https://michaelellerbeck.com/2009/04/14/chapter-3-the-internet-lockdown/ (Scroll Down to 3.1)

So if you want to install squid for windows on the non default drive its a little tricky. Not that tricky once you figure it out though!

First, unzip your files. Lets say to D:\Squid (The path to your sbin should look like D:\Squid\Sbin)

Next do a search and replace on C:/ (notice forward slash) and replace with D:/ in the D:/Squid/etc/squid.conf file

Then, uncomment the line that specifies meme.conf (do a search and then delete the # in front of the line)

Uncomment unlinkd_program D:/squid/libexec/unlinkd.exe

Uncomment logfile_daemon D:/squid/libexec/logfile-daemon.exe

Uncomment Icon Directory D:/squid/share/icons

UncommentError Directory D:/squid/share/errors/English

Uncomment cache_store_log d:/squid/var/logs/store.log

Uncomment cache_log d:/squid/var/logs/cache.log

Uncomment pid_filename d:/squid/var/logs/squid.pid

Ok, now we are going to install the squid service using the D:/squid/etc/squid.conf file the command to type is

(You have a command prompt at the D:\Squid\Sbin\ folder)

squid -i -f “d:/squid/etc/squid.conf”

Now we need to set the commandline variable of the service to point to the config file as well so type

squid -O “-f d:/squid/etc/squid.conf”

Ok, now initialize the cache using the config file so type

squid -z -f “d:/squid/etc/squid.conf”

Ok, now you can start the service!

net start squid! Enjoy a new path to your squid life