Sorry! Here is the patch!
On Fri, Jun 19, 2015 at 11:49 AM, Zsolt Papp <[email protected]>
wrote:
> Hi!
>
> My name is Zsolt Papp.
> I have created a little patch to make work the client authentication by
> certificates.
> I attached the patch.
>
> Please add this apply this patch on the project or give me commit rights.
>
> Thank you!
>
> Regards,
> Zsolt Papp
>
>
Index:
jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
===================================================================
---
jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
(revision 976)
+++
jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
(working copy)
@@ -64,6 +64,7 @@
import com.gargoylesoftware.htmlunit.util.Cookie;
import com.gargoylesoftware.htmlunit.util.NameValuePair;
import com.gargoylesoftware.htmlunit.xml.XmlPage;
+
import net.sourceforge.jwebunit.api.HttpHeader;
import net.sourceforge.jwebunit.api.IElement;
import net.sourceforge.jwebunit.api.ITestingEngine;
@@ -82,6 +83,7 @@
import net.sourceforge.jwebunit.javascript.JavascriptConfirm;
import net.sourceforge.jwebunit.javascript.JavascriptPrompt;
import net.sourceforge.jwebunit.util.TestContext;
+
import org.apache.http.auth.AuthScope;
import org.apache.regexp.RE;
import org.apache.regexp.RESyntaxException;
@@ -181,6 +183,12 @@
*/
private int timeout = 0;
+private URL sslClientCertificateUrl;
+
+private String sslClientCertificatePassword;
+
+private String sslClientCertificateType;
+
// Implementation of IJWebUnitDialog
/**
@@ -866,7 +874,10 @@
wc.getOptions().setThrowExceptionOnFailingStatusCode(!ignoreFailingStatusCodes);
wc.getOptions().setThrowExceptionOnScriptError(throwExceptionOnScriptError);
wc.getOptions().setRedirectEnabled(true);
+
wc.getOptions().setUseInsecureSSL(true);
+ wc.getOptions().setSSLClientCertificate(sslClientCertificateUrl,
sslClientCertificatePassword, sslClientCertificateType);
+
if (refreshHandler == null) {
wc.setRefreshHandler(new ImmediateRefreshHandler());
} else {
@@ -2523,4 +2534,10 @@
}
}
+ public void setSSLClientCertificate(final URL certificateUrl, final String
certificatePassword,
+ final String certificateType) {
+ sslClientCertificateUrl = certificateUrl;
+ sslClientCertificatePassword = certificatePassword;
+ sslClientCertificateType = certificateType;
+ }
}
------------------------------------------------------------------------------
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development