[JIRA] (JENKINS-14492) IAE Illegal character(s) in message header value from com.saucelabs.rest.Credential.call
jglick closed JENKINS-14492 as Fixed IAE Illegal character(s) in message header value from com.saucelabs.rest.Credential.call User says the 1.18 plugin is working as expected. Thanks! Change By: jglick (24/Jul/12 5:50 PM) Status: Resolved Closed This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira
[JIRA] (JENKINS-14492) IAE Illegal character(s) in message header value from com.saucelabs.rest.Credential.call
SCM/JIRA link daemon commented on JENKINS-14492 IAE Illegal character(s) in message header value from com.saucelabs.rest.Credential.call Code changed in jenkins User: Ross Rowe Path: pom.xml src/main/java/hudson/plugins/sauce_ondemand/PluginImpl.java src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandBuildWrapper.java src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandReportPublisher.java http://jenkins-ci.org/commit/sauce-ondemand-plugin/f3f6f09c65049a47ce7c6d1ef53c08cb83a1b602 Log: JENKINS-14492 Update Sauce REST API usage This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira
[JIRA] (JENKINS-14492) IAE Illegal character(s) in message header value from com.saucelabs.rest.Credential.call
Ross Rowe resolved JENKINS-14492 as Fixed IAE Illegal character(s) in message header value from com.saucelabs.rest.Credential.call A fix for this issue has been included in version 1.18 of the plugin (this version also uses the latest Sauce Java REST API library Change By: Ross Rowe (20/Jul/12 11:40 PM) Status: InProgress Resolved Resolution: Fixed This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira
[JIRA] (JENKINS-14492) IAE Illegal character(s) in message header value from com.saucelabs.rest.Credential.call
jglick created JENKINS-14492 IAE Illegal character(s) in message header value from com.saucelabs.rest.Credential.call Issue Type: Bug Assignee: Kohsuke Kawaguchi Components: sauce-ondemand Created: 18/Jul/12 8:08 PM Description: A user reports getting an error message when attempting to use the Test Connection button. The meat of the exception is java.lang.IllegalArgumentException: Illegal character(s) in message header value: Basic someLongBase64EncodedMessHereEtcEtcEtcEtcEtcEtcEtcEtcEtcEtcEtcEtcEtcAndAnEOL sun.net.www.protocol.http.HttpURLConnection.checkMessageHeader(HttpURLConnection.java:428) sun.net.www.protocol.http.HttpURLConnection.isExternalMessageHeaderAllowed(HttpURLConnection.java:394) sun.net.www.protocol.http.HttpURLConnection.setRequestProperty(HttpURLConnection.java:2374) sun.net.www.protocol.https.HttpsURLConnectionImpl.setRequestProperty(HttpsURLConnectionImpl.java:296) com.saucelabs.rest.Credential.call(Credential.java:167) com.saucelabs.rest.Credential.call(Credential.java:151) com.saucelabs.rest.SauceTunnelFactory.list(SauceTunnelFactory.java:88) hudson.plugins.sauce_ondemand.PluginImpl$DescriptorImpl.doValidate(PluginImpl.java:137) Note that HttpURLConnection is complaining rightly that the authentication string contains a newline. Credential.call has String userpassword = username + ":" + key; con.setRequestProperty("Authorization", "Basic " + new BASE64Encoder().encode(userpassword.getBytes())); You can see that this will fail in some cases: public class Demo { public static void main(String... args) { System.out.println("got: '" + new sun.misc.BASE64Encoder().encode(new String("someusername:apiKeyEtc01234567890123456789012345678901234").getBytes()) + "'"); } } produces got: 'c29tZXVzZXJuYW1lOmFwaUtleUV0YzAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0 ' http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6947917 discusses a similar bug in the JRE, and suggests the workaround: public class Demo { public static void main(String... args) { System.out.println("got: '" + new sun.misc.BASE64Encoder() { @Override protected int bytesPerLine() { return ; } }.encode(new String("someusername:apiKeyEtc01234567890123456789012345678901234").getBytes()) + "'"); } } producing got: 'c29tZXVzZXJuYW1lOmFwaUtleUV0YzAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0' By the way https://github.com/infradna/saucerest-java/ seems to be the source of the REST API, but this appears long out of date whereas https://github.com/saucelabs/saucerest-java/ looks to be the authoritative library (which however still appears to suffer from this same bug, at least according to an inspection of sources). Environment: 1.14 Project: Jenkins Priority: Major Reporter: jglick This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira
[JIRA] (JENKINS-14492) IAE Illegal character(s) in message header value from com.saucelabs.rest.Credential.call
jglick assigned JENKINS-14492 to Ross Rowe IAE Illegal character(s) in message header value from com.saucelabs.rest.Credential.call Change By: jglick (18/Jul/12 8:16 PM) Assignee: KohsukeKawaguchi RossRowe This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira
[JIRA] (JENKINS-14492) IAE Illegal character(s) in message header value from com.saucelabs.rest.Credential.call
Ross Rowe started work on JENKINS-14492 IAE Illegal character(s) in message header value from com.saucelabs.rest.Credential.call Change By: Ross Rowe (19/Jul/12 12:06 AM) Status: Open InProgress This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira