Hi,
I'm trying to write a xmlrpc client that can connect to a https server which doesn't have a known certificate.
I can do it with a normal HttpsURLConnection using the class at the end of this email, but i haven't been able to figure out how to do a similar thing with the apache xmlrpc2. can anyone help me with this, or point me towards some documentation which would help me?
note that i'm using version 2.0.1, cause i'm using java 1.4. Is version 3 available for java 1.4? when i tried to use it to said something bout being the wrong version. maybe i'm doing something wrong?
Thanks in advance
_tristan
public class HttpsClient {
private static TrustManager[] alltms = new TrustManager[] {
new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {}
public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {}
}
};
public static void main(String[] args) {
try {
URL u = new URL(args[0]);
HttpsURLConnection huc = (HttpsURLConnection)u.openConnection();
SSLContext sslc = SSLContext.getInstance("TLS");
sslc.init(null, alltms, null);
huc.setSSLSocketFactory(sslc.getSocketFactory());
BufferedReader br = new BufferedReader(new InputStreamReader(
huc.getInputStream()));
String s = br.readLine();
while (s != null) {
System.out.print(s);
s = br.readLine();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
- xmlrpc2 setting custom trust manager for SSL connections Tristan King
- Re: xmlrpc2 setting custom trust manager for SSL conn... Jochen Wiedmann
- Re: xmlrpc2 setting custom trust manager for SSL ... Tristan King
- Re: xmlrpc2 setting custom trust manager for ... Jochen Wiedmann
- Re: xmlrpc2 setting custom trust manager ... Tristan King
- Re: xmlrpc2 setting custom trust man... Jochen Wiedmann
