Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Doubt on sun.net.www.http.HttpClient class whether it supports https protoc

user637169Apr 3 2013 — edited Apr 4 2013
Dear All,

My requirement is to call HTTPS URL through java code(through HTTP URL call).
for that I am using sun.net.www.http.HttpClient class.

I need to know whether sun.net.www.http.HttpClient class supports only HTTP or it supports HTTPS also.

target host is accessible from the machine where application is running. I checked with telnet command

I am getting connection refused error when i am accessing HTTPS URL through java code


TWKOnlineSubmit | submitWithResponse | SocketException : java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
at sun.reflect.GeneratedConstructorAccessor196.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1491)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1485)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139)
at com.crimsonlogic.thb.twkonline.TWKOnlineSubmit.submitWithResponse(TWKOnlineSubmit.java:350)
at com.crimsonlogic.thb.test.servlet.TWKOnlineSubmitServlet.submit(TWKOnlineSubmitServlet.java:128)
at com.crimsonlogic.thb.test.servlet.TWKOnlineSubmitServlet.doPost(TWKOnlineSubmitServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)

Edited by: user637169 on Apr 3, 2013 5:05 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2013
Added on Apr 3 2013
5 comments
5,605 views