File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Getting services to work with NTLM Authentication over HTTPS/SSL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Getting services to work with NTLM Authentication over HTTPS/SSL" Watch "Getting services to work with NTLM Authentication over HTTPS/SSL" New topic
Author

Getting services to work with NTLM Authentication over HTTPS/SSL

Simon Pink
Greenhorn

Joined: Dec 19, 2008
Posts: 4
I cannot seem to get NTLM working with SSL/HTTPS. I get the following exception:
   java.lang.NoSuchMethodException: jcifs.http.NtlmHttpURLConnection.getSSLSocketFactory()

I am using the NTLM Authentication example almost verbatim, and then used a conduit set to allow HTTPS (example to follow).

It seems that the NtlmHttpURLConnection doesn't support SSL, is there an implementation that does? Is it actually possible to use both SSL and NTLM using CXF (or any other JAX-WS implementation)? I would have thought it would be a reasonably common requirement with Sharepoint so prolific in the marketplace?



Simon Pink
Greenhorn

Joined: Dec 19, 2008
Posts: 4
After going through the very helpful CXF and JCIFs mailing lists I found the answer to my problem, I thought I would post here in case others find it useful.

Basically, as of JDK 6 NTLM authentication is cross-platform (I love you Sun). As a result JCIF's will be stripping all HTTPConnection related code from their code base. You can also specify the username/password to use. The first attempt will use the logged in users credentials (if on windows), after which it will use the supplied username/password.

So, a complete example using HTTPS and NTLM based on the code from the Sun JDK6 Authentication page, the CXF HTTPS Example page, and the trust all manager from the trying to solve IT problems page.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Getting services to work with NTLM Authentication over HTTPS/SSL