Objectmix
Tags Register Mark Forums Read

Programmatically specify client cert as part of web service call : Java

This is a discussion on Programmatically specify client cert as part of web service call within the Java forums in Programming Languages category; 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....


Object Mix > Programming Languages > Java > Programmatically specify client cert as part of web service call

Reply

 

LinkBack Thread Tools
  #1  
Old 01-01-2004, 03:42 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Programmatically specify client cert as part of web service call

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.
Reply With Quote
  #2  
Old 01-11-2004, 03:11 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Programmatically specify client cert as part of web service call

tkaupe@hotmail.com (Tom) wrote in message news:<c0deb3f7.0401011241.3f049b2c@posting.google. com>...
> 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.


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.g etSocketFactory());
}
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.
Reply With Quote
  #3  
Old 01-11-2004, 08:31 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Programmatically specify client cert as part of web service call

Tom wrote:
> tkaupe@hotmail.com (Tom) wrote in message news:<c0deb3f7.0401011241.3f049b2c@posting.google. com>...
>
>>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.

>
>
> 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>


"used"? or "uses"?

>
> try
> {
> SSLContext sc = SSLContext.getInstance("SSL");
> sc.init(keyManagers, trustManagers, new java.security.SecureRandom());
> HttpsURLConnection.setDefaultSSLSocketFactory(sc.g etSocketFactory());
> }
> 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.


--Mike Amling

Reply With Quote
Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
AJAX client web service call usenet DOTNET 2 12-03-2007 02:04 PM
Client Cert Delegation to Web Service usenet DOTNET 2 08-29-2007 09:36 AM
Client Cert Delegation to Web Service usenet DOTNET 0 08-29-2007 08:31 AM
Capturing a Client Cert and Passing it to a Secure Web Service usenet DOTNET 0 08-28-2007 03:39 PM


All times are GMT -5. The time now is 08:37 AM.