Bug - Fixed Proxy Settings in r10587

holatuwol

Developer
"sslContext.init" could be a bug in the Java 1.7.0_04 early access, since I don't see any problems with 1.7.0_03.

Did you test with the combination of "sslContext.init( null, null, null )" and "Don't validate SSL certificates" unticked?
 

Catch-22

Active member
Did you test with the combination of "sslContext.init( null, null, null )" and "Don't validate SSL certificates" unticked?

Yeah, same result ticked and unticked.

Code:
Sending login request...
Time out during data post (login.php). This could be bad...
Time out during response (login.php).
Time out during data post (login.php). This could be bad...
Time out during response (login.php).
Requests complete.
 

Catch-22

Active member
"sslContext.init" could be a bug in the Java 1.7.0_04 early access, since I don't see any problems with 1.7.0_03.

Okay, I downgraded to 1.7.0_03 but straight afterwards I noticed you commit r10676, haha.

Anyway, here's some exciting news, I can finally see some traffic on my proxy, it appears to be working correctly in r10676 with Java 1.7.0_03 but only if I have "Do not have Java try to validate SSL certificates" ticked.
 

Winterbay

Active member
It still seems to generate debuglogs (java 6.23):
Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
         KoLmafia v15.1 r10677, Windows XP, Java 1.6.0_23
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post this log in the KoLmafia thread. If you
 would like the dev team to look at it, please write a bug report
 at kolmafia.us. Include specific information about what you were 
 doing when you made this and include the log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Wed Feb 29 08:25:52 CET 2012
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
	at sun.net.www.protocol.http.HttpURLConnection.doTunneling(Unknown Source)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.setProxiedClient(Unknown Source)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.setProxiedClient(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
	at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:1549)
	at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1361)
	at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1254)
	at net.sourceforge.kolmafia.request.LoginRequest.run(LoginRequest.java:268)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:221)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:184)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.doLogin(LoginFrame.java:335)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.actionConfirmed(LoginFrame.java:294)
	at net.sourceforge.kolmafia.swingui.panel.GenericPanel$ConfirmedListener.execute(GenericPanel.java:604)
	at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:239)
	at net.sourceforge.kolmafia.RequestThread$ThreadWrappedRunnable.run(RequestThread.java:340)

I got the same log no matter what combination of options I picked.
 

holatuwol

Developer
Testing with Java 1.6.0_31 on Xubuntu 11.10 (32-bit), creating a VM with just a host-only adapter and thus no other ability to connect to the internet except through the polipo proxy running on the host machine, I am able to consistently get it to work no matter what my settings are.

To make sure it's not being sneaky, if I shut down the proxy server, everything stops working (as I would expect with a host-only network adapter), and if I turn on debug logging with the proxy turned off, the gCLI prints out the same "Time out during data post (login.php). This could be bad..." messages we've all grown to know and love.

So, I (sadly) cannot reproduce the problems currently being experienced by anyone, making me wonder if it's related to Java version (I'm running 1.6.0_31 rather than the 1.6.0_23 that Winterbay is running, and rather than the 1.7.0_03 that Catch-22 is running) or operating system (you two are running Windows, while I'm running Xubuntu). I can try doing the same test on a Windows VM tomorrow to rule that out.

Edit: It could also be the proxy server that's causing problems. I can download the JRE 1.6.0_23 source code to see what in doTunneling() could throw a null pointer exception. (And it turns out it doesn't have the source code for that class, but it is available online to poke at ... would be nice if your stack trace had line numbers, but you're probably using a JRE?)
 
Last edited:

Winterbay

Active member
I am indeed using a JRE as I cannot install anything myself on this work laptop. I have the JDK at home, but that is of course not behind the proxy and so wouldn't help (as I can log in just fine with SSL activated there, tested yesterday).
 

Veracity

Developer
Staff member
How is this going, hola? Will we be ready to switch to SSL when KoL forces us to do so?
 

holatuwol

Developer
Not too good, I think I need a 32-bit Windows XP to test, since the computer that I installed the proxy server on won't let VirtualBox use 64-bit Windows.

That being said, I didn't think of trying to test with 32-bit Ubuntu with the older version of the JDK to see if it's Java 1.6.0 update 23 with the problem in general. I can do that later tonight.
 
Last edited:

fronobulax

Developer
Staff member
Not too good, I think I need a 32-bit Windows XP to test, since the computer that I installed the proxy server on won't let VirtualBox use 64-bit Windows.

That being said, I didn't think of trying to test with 32-bit Ubuntu with the older version of the JDK to see if it's Java 1.6.0 update 23 with the problem in general. I can do that later tonight.

Interesting. The part about Ubuntu was not displayed in my browser until I quoted to edit.

I run a couple of 32 bit XP VMs for various tasks so if you tell me what is to be tested and what the setup is then I might be able to assist. I presume (in general) it is to set up a VM that uses a proxy (hosted elsewhere) and then run mafia...
 

holatuwol

Developer
1. Setup a proxy server locally.
2. Install Java 1.6.0 update 23 to a VM using host-only networking.
3. Run KoLmafia, adjust your proxy settings, and attempt to login.

If it doesn't work:

4. Follow the instructions here: http://java.com/en/download/help/proxy_setup.xml
5. Delete your existing KoLmafia settings.
6. Run KoLmafia and attempt to login.

It might automatically initialize with the settings you set in the Control Panel, but I think those Java settings only apply to applets. But hey, if it works, it works.
 

Catch-22

Active member
Okay, I've been away for a while so I haven't done any testing. Here's what I'm getting in r10733 with java version "1.7.0_04-ea".
IOException during data post (login.php).
Code:
class javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.ssl.Alerts.getSSLException(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
	at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
	at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
	at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
	at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
	at sun.security.ssl.Handshaker.processLoop(Unknown Source)
	at sun.security.ssl.Handshaker.process_record(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
	at net.sourceforge.kolmafia.request.GenericRequest.postClientData(GenericRequest.java:1524)
	at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1378)
	at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1271)
	at net.sourceforge.kolmafia.request.LoginRequest.run(LoginRequest.java:268)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:221)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:184)
	at net.sourceforge.kolmafia.KoLmafiaCLI.attemptLogin(KoLmafiaCLI.java:169)
	at net.sourceforge.kolmafia.textui.command.LoginCommand.run(LoginCommand.java:49)
	at net.sourceforge.kolmafia.KoLmafiaCLI.doExecuteCommand(KoLmafiaCLI.java:548)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:501)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:402)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:270)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.handleQueue(CommandDisplayFrame.java:181)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.run(CommandDisplayFrame.java:155)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
	at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
	at sun.security.validator.Validator.validate(Unknown Source)
	at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
	... 26 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
	at java.security.cert.CertPathBuilder.build(Unknown Source)
	... 32 more
IOException during data post (login.php).
class sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
	at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
	at sun.security.validator.Validator.validate(Unknown Source)
	at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
	at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
	at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
	at sun.security.ssl.Handshaker.processLoop(Unknown Source)
	at sun.security.ssl.Handshaker.process_record(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
	at net.sourceforge.kolmafia.request.GenericRequest.postClientData(GenericRequest.java:1524)
	at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1378)
	at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1271)
	at net.sourceforge.kolmafia.request.LoginRequest.run(LoginRequest.java:268)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:221)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:184)
	at net.sourceforge.kolmafia.KoLmafiaCLI.attemptLogin(KoLmafiaCLI.java:169)
	at net.sourceforge.kolmafia.textui.command.LoginCommand.run(LoginCommand.java:49)
	at net.sourceforge.kolmafia.KoLmafiaCLI.doExecuteCommand(KoLmafiaCLI.java:548)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:501)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:402)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:270)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.handleQueue(CommandDisplayFrame.java:181)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.run(CommandDisplayFrame.java:155)
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
	at java.security.cert.CertPathBuilder.build(Unknown Source)
	... 32 more

Seems to be a step backwards from last time I tried where everything was working for me as long as I had "don't validate certificates" ticked.

Unfortunately I don't really have much time at the moment to fiddle with custom builds or anything like that, but I'll try out the latest builds from SVN when I can and let you know how things go.
 

Winterbay

Active member
So, I decided to give this another twirl with the new logging-in options and so on. Logging in without starting a debug log gives no messages otehr than failing ot log in and no debuglog (which I guess is an improvement of sorts). Starting a debuglog first gave the following:
Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
         KoLmafia v15.1 r10733, Windows XP, Java 1.6.0_23
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post this log in the KoLmafia thread. If you
 would like the dev team to look at it, please write a bug report
 at kolmafia.us. Include specific information about what you were 
 doing when you made this and include the log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Tue Mar 06 08:11:38 CET 2012
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Sending login request...
class net.sourceforge.kolmafia.request.LoginRequest
Connecting to login.php...

Requesting: https://www.kingdomofloathing.com/login.php?password&secure=0&loginname=molman&loggingin=Yup.
3 request properties

Field: User-Agent = [KoLmafia v15.1]
Field: Connection = [close]
Field: Content-Type = [application/x-www-form-urlencoded]

IOException during data post (login.php).
class java.io.IOException: Authentication failure
java.io.IOException: Authentication failure
	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.getOutputStream(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
	at net.sourceforge.kolmafia.request.GenericRequest.postClientData(GenericRequest.java:1524)
	at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1378)
	at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1271)
	at net.sourceforge.kolmafia.request.LoginRequest.run(LoginRequest.java:268)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:221)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:184)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.doLogin(LoginFrame.java:335)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.actionConfirmed(LoginFrame.java:294)
	at net.sourceforge.kolmafia.swingui.panel.GenericPanel$ConfirmedListener.execute(GenericPanel.java:604)
	at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:239)
	at net.sourceforge.kolmafia.RequestThread$ThreadWrappedRunnable.run(RequestThread.java:340)
IOException during data post (login.php).
IOException during data post (login.php).


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
         KoLmafia v15.1 r10733, Windows XP, Java 1.6.0_23
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post this log in the KoLmafia thread. If you
 would like the dev team to look at it, please write a bug report
 at kolmafia.us. Include specific information about what you were 
 doing when you made this and include the log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Tue Mar 06 08:13:02 CET 2012
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Sending login request...
class net.sourceforge.kolmafia.request.LoginRequest
Connecting to login.php...

Requesting: https://www.kingdomofloathing.com/login.php?password&secure=0&loginname=molman&loggingin=Yup.
3 request properties

Field: User-Agent = [KoLmafia v15.1]
Field: Connection = [close]
Field: Content-Type = [application/x-www-form-urlencoded]

IOException during data post (login.php).
class java.io.IOException: Authentication failure
java.io.IOException: Authentication failure
	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.getOutputStream(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
	at net.sourceforge.kolmafia.request.GenericRequest.postClientData(GenericRequest.java:1524)
	at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1378)
	at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1271)
	at net.sourceforge.kolmafia.request.LoginRequest.run(LoginRequest.java:268)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:221)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:184)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.doLogin(LoginFrame.java:335)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.actionConfirmed(LoginFrame.java:294)
	at net.sourceforge.kolmafia.swingui.panel.GenericPanel$ConfirmedListener.execute(GenericPanel.java:604)
	at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:239)
	at net.sourceforge.kolmafia.RequestThread$ThreadWrappedRunnable.run(RequestThread.java:340)
IOException during data post (login.php).
IOException during data post (login.php).
Sending login request...
class net.sourceforge.kolmafia.request.LoginRequest
Connecting to login.php...

Requesting: https://www.kingdomofloathing.com/login.php?password&secure=0&loginname=molman&loggingin=Yup.
3 request properties

Field: User-Agent = [KoLmafia v15.1]
Field: Connection = [close]
Field: Content-Type = [application/x-www-form-urlencoded]

IOException during data post (login.php).
class java.io.IOException: Authentication failure
java.io.IOException: Authentication failure
	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.getOutputStream(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
	at net.sourceforge.kolmafia.request.GenericRequest.postClientData(GenericRequest.java:1524)
	at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1378)
	at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1271)
	at net.sourceforge.kolmafia.request.LoginRequest.run(LoginRequest.java:268)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:221)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:184)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.doLogin(LoginFrame.java:335)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.actionConfirmed(LoginFrame.java:294)
	at net.sourceforge.kolmafia.swingui.panel.GenericPanel$ConfirmedListener.execute(GenericPanel.java:604)
	at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:239)
	at net.sourceforge.kolmafia.RequestThread$ThreadWrappedRunnable.run(RequestThread.java:340)
IOException during data post (login.php).
IOException during data post (login.php).
Sending login request...
class net.sourceforge.kolmafia.request.LoginRequest
Connecting to login.php...

Requesting: https://www.kingdomofloathing.com/login.php?password&secure=0&loginname=molman&loggingin=Yup.
3 request properties

Field: User-Agent = [KoLmafia v15.1]
Field: Connection = [close]
Field: Content-Type = [application/x-www-form-urlencoded]

IOException during data post (login.php).
class java.io.IOException: Authentication failure
java.io.IOException: Authentication failure
	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.getOutputStream(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
	at net.sourceforge.kolmafia.request.GenericRequest.postClientData(GenericRequest.java:1524)
	at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1378)
	at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1271)
	at net.sourceforge.kolmafia.request.LoginRequest.run(LoginRequest.java:268)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:221)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:184)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.doLogin(LoginFrame.java:335)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.actionConfirmed(LoginFrame.java:294)
	at net.sourceforge.kolmafia.swingui.panel.GenericPanel$ConfirmedListener.execute(GenericPanel.java:604)
	at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:239)
	at net.sourceforge.kolmafia.RequestThread$ThreadWrappedRunnable.run(RequestThread.java:340)
IOException during data post (login.php).
IOException during data post (login.php).

The options used were (IIRC) in order:
1) Proxy, HTTPS, No validation, Improve handling of lag spikes
2) Proxy, HTTPS, No validation
3) Proxy, HTTPS
4) Proxy, HTTPS, Improve handling of lag spikes

This with Java 6.23, XP Pro (32 bit) and an annoying corporate proxy...
 

holatuwol

Developer
Okay, I've been away for a while so I haven't done any testing. Here's what I'm getting in r10733 with java version "1.7.0_04-ea".
The log is helpful, at least. It says that Java 1.7.0 update 4 early access (which never worked), unlike Java 1.7.0 update 3 (which worked), still tries to use certificate validation no matter what we mark there. Rather than implement a naive one, we'll probably have to create a custom certificate store file with the KoL cert and bundle it with KoLmafia. Not high on my priority list, but if you have to do it, you have to do it.

This with Java 6.23, XP Pro (32 bit) and an annoying corporate proxy...
"Authentication failed" hints at a bad username/password in the proxy settings, or Java doing something stupid with the correct data that you do enter. I'll see if I can find a way to get a proxy server that I can install locally which requires authentication of some sort.
 
Last edited:

Winterbay

Active member
"Authentication failed" hints at a bad username/password in the proxy settings, or Java doing something stupid with the correct data that you do enter. I'll see if I can find a way to get a proxy server that I can install locally which requires authentication of some sort.

Hmm... Interesting. Mafia has fields for username and password for the proxy, but I've never had to use them (and still don't for the normal case). I'm not sure if I've tested by entering that info into the system. I'll try that tomorrow and see if there's any change.
 

Catch-22

Active member
The log is helpful, at least. It says that Java 1.7.0 update 4 early access (which never worked), unlike Java 1.7.0 update 3 (which worked), still tries to use certificate validation no matter what we mark there. Rather than implement a naive one, we'll probably have to create a custom certificate store file with the KoL cert and bundle it with KoLmafia.

Why would it be trying to validate the certificate? It doesn't even seem to be running the naive routine. Any way we can force this?

Also noticing in my most recent debug logs that my password no longer appears in the request URL, is this because KoLmafia is censoring it for me, a bug, or something else?
 

Catch-22

Active member

Ah, I only checked back to 10699, haha. Thanks Theraze.

I added additional logging to see if that code is even called. If I were to guess, it's a bug with early access.

Is this something you haven't yet committed, or are you referring to r10733? I last tested with r10739 and it doesn't seem to call the naive code at all.

I've downgraded to 1.7.0_03 and will probably stick with it until 1.7.0_04 is stable. I can confirm that KoLmafia still works as expected in r10739 with 1.7.0_03 provided you have "don't validate SSL certificates" ticked. For whatever reason, the naive code doesn't seem to be called in 1.7.0_04ea regardless of the checkbox state, it appears to be a bug only isolated to the early-access, so I'd say ignore it for now.

Here's the latest debug log I have from 1.7.0_03, if you're interested. This only happens if you have Java try to validate the SSL certificate through a proxy.

Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
         KoLmafia v15.1 r10739, Windows 7, Java 1.7.0_03
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post this log in the KoLmafia thread. If you
 would like the dev team to look at it, please write a bug report
 at kolmafia.us. Include specific information about what you were 
 doing when you made this and include the log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Wed Mar 07 10:49:55 CST 2012
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Installing default certificate validation...
Sending login request...
class net.sourceforge.kolmafia.request.LoginRequest
Connecting to login.php...

Requesting: https://www.kingdomofloathing.com/login.php?password&secure=0&loginname=username%2Fq&loggingin=Yup.
3 request properties

Field: User-Agent = [KoLmafia v15.1]
Field: Connection = [close]
Field: Content-Type = [application/x-www-form-urlencoded]

IOException during data post (login.php).
class javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.ssl.Alerts.getSSLException(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
	at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
	at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
	at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
	at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
	at sun.security.ssl.Handshaker.processLoop(Unknown Source)
	at sun.security.ssl.Handshaker.process_record(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
	at net.sourceforge.kolmafia.request.GenericRequest.postClientData(GenericRequest.java:1539)
	at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1393)
	at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1286)
	at net.sourceforge.kolmafia.request.LoginRequest.run(LoginRequest.java:268)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:221)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:184)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.doLogin(LoginFrame.java:335)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.actionConfirmed(LoginFrame.java:294)
	at net.sourceforge.kolmafia.swingui.panel.GenericPanel$ConfirmedListener.execute(GenericPanel.java:604)
	at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:239)
	at net.sourceforge.kolmafia.RequestThread$ThreadWrappedRunnable.run(RequestThread.java:340)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
	at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
	at sun.security.validator.Validator.validate(Unknown Source)
	at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
	... 23 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
	at java.security.cert.CertPathBuilder.build(Unknown Source)
	... 29 more
IOException during data post (login.php).
class sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
	at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
	at sun.security.validator.Validator.validate(Unknown Source)
	at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
	at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
	at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
	at sun.security.ssl.Handshaker.processLoop(Unknown Source)
	at sun.security.ssl.Handshaker.process_record(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
	at net.sourceforge.kolmafia.request.GenericRequest.postClientData(GenericRequest.java:1539)
	at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1393)
	at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1286)
	at net.sourceforge.kolmafia.request.LoginRequest.run(LoginRequest.java:268)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:221)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:184)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.doLogin(LoginFrame.java:335)
	at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.actionConfirmed(LoginFrame.java:294)
	at net.sourceforge.kolmafia.swingui.panel.GenericPanel$ConfirmedListener.execute(GenericPanel.java:604)
	at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:239)
	at net.sourceforge.kolmafia.RequestThread$ThreadWrappedRunnable.run(RequestThread.java:340)
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
	at java.security.cert.CertPathBuilder.build(Unknown Source)
	... 29 more
IOException during data post (login.php).
IOException during data post (login.php).
 
Last edited:
Top