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....
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| 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. |
|
#2
| |||
| |||
| 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. |
|
#3
| |||
| |||
| 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 |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| |
| ||||
| 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.




