Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / January 2004

Tip: Looking for answers? Try searching our database.

Programmatically specify client cert as part of web service call

Thread view: 
Tom - 01 Jan 2004 20:41 GMT
I have several client certs in my certstore/cacert files and would
like to programmatically specify which should be included in a WS
call.  I would like to do this independent of the server requiring
SSL.

This is possible in .NET using the ClientCertificates collection of
the SoapHttpClientProtocol class.  I haven't found the java
equivalent.
Tom - 11 Jan 2004 08:11 GMT
> I have several client certs in my certstore/cacert files and would
> like to programmatically specify which should be included in a WS
[quoted text clipped - 4 lines]
> the SoapHttpClientProtocol class.  I haven't found the java
> equivalent.

Ok, forget about selecting a specific cert to use; I can't even a
single cert to work.  Here's what I have so far:

<codeSnippet>
TrustManager[] trustManagers = <uses .pks file>
KeyManager[] keyManagers = <used .p12 file>
   
try
{
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(keyManagers, trustManagers, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
}
catch (Exception ex) { ... }
</codeSnippet>

I have confirmed that the TrustManager is using the certs in the .pks
for the SSL handshake.  However, no local cert is being sent.
Michael Amling - 11 Jan 2004 13:31 GMT
>>I have several client certs in my certstore/cacert files and would
>>like to programmatically specify which should be included in a WS
[quoted text clipped - 11 lines]
> TrustManager[] trustManagers = <uses .pks file>
> KeyManager[] keyManagers = <used .p12 file>

  "used"? or "uses"?

>    
> try
[quoted text clipped - 8 lines]
> I have confirmed that the TrustManager is using the certs in the .pks
> for the SSL handshake.  However, no local cert is being sent.

--Mike Amling


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.