• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How I make a web client except any certificate via https

 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have jax-ws web service runs via http. There is a wsdl.
I wrote a client that fails on handshake because of the certificate.
How I make the client except everything and just work.
In c# I had to add the following lines of code:


and then the usage:



thanks.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Have you tried including the following code snipped on the client side?

If there are problems, try modifying the verify method so that it always returns true.
Best wishes!
 
John Landon
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot but I do not see that the method verify is being hit (and it did not work) although : HttpsURLConnection.setDefaultHostnameVerifier is executed
 
John Landon
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
by the way these are the imports I made:
javax.net.ssl.HttpsURLConnection
javax.net.ssl.HostnameVerifier

are these correct?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

John Landon wrote:by the way these are the imports I made:
javax.net.ssl.HttpsURLConnection
javax.net.ssl.HostnameVerifier
are these correct?


Yes, they are correct.
Did you generate the portable artifacts for the web service client with wsimport?
Best wishes!
 
John Landon
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank a lot. But this utility does not work. It says:

parsing WSDL...


[ERROR] sun.security.validator.ValidatorException: PKIX path building failed: s
n.security.provider.certpath.SunCertPathBuilderException: unable to find valid
ertification path to requested target

Failed to read the WSDL document: https://localhost:9091/services/WebService?ws
l, because 1) could not find the document; /2) the document could not be read;
) the root element of the document is not <wsdl:definitions>.


[ERROR] failed.noservice=Could not find wsdl:service in the provided WSDL(s):

At least one WSDL with at least one service definition needs to be provided.


Failed to parse the WSDL.



My wsdl is:

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic