Usage of URLConnection in EAR.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Usage of URLConnection in EAR.

This post has NOT been accepted by the mailing list yet.
Hello together,

in my application I have to check the content of a URL. For this purpose I use the URLConnection.
Here is some Code...

        URLConnection crlConnection = url.openConnection();
        try (InputStream is = crlConnection.getInputStream()) {

In come cases the URL is an https url, and for this I want to set my own ssl socket factory.
Like this e.g. newConnection = (HttpsURLConnection) u.openConnection();

And here i got an ClassCastException: cannot be cast to

How can I do this, or are there any other ways in wildfly?

Thanks in advance.