I am jumping in on this a bit late, but this sounds similar to a problem I had. What I did was to use HttpsURLConnection.getDefaultSSLSocketFactory() and wrap that with the HttpClient's socket factory class. This way, when HttpClient connects a socket, it uses the "native" one. (In my case, I was using Webstart, and needed to access the one it used.)
You may need to establish an HttpsURLConnection (and throw it away) first to initialize the connection. I don't know if that is necessary now or not. (There was a bug in early Java 6 that necessitated this.) It is a bit tedious to do this in HttpClient 4.1, and you end up just copying lots of code since there are private variables that get in the way. In 4.2, there is a constructor to HttpClient's socket factory that will wrap a socket factory for you. -----Original Message----- From: Matthew Young [mailto:[email protected]] Sent: Tuesday, June 26, 2012 11:20 AM To: [email protected] Subject: Re: HTTPClient ntlm smart card Tested the following: String url = "http://www.google.com/", proxy = "<our proxy>", port = "8080"; URL server = new URL(url); Properties systemProperties = System.getProperties(); systemProperties.setProperty("http.proxyHost", proxy); systemProperties.setProperty("http.proxyPort", port); HttpURLConnection connection = (HttpURLConnection) server.openConnection(); connection.connect(); BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) System.out.println(inputLine); in.close(); And just like you said it works. Will look at the HttpURLConnection code. Thanks -- View this message in context: http://old.nabble.com/HTTPClient-ntlm-smart-card-tp34070660p34073158.html Sent from the HttpClient-User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
