File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes https -- connects fine on windows / error on unix Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "https -- connects fine on windows / error on unix" Watch "https -- connects fine on windows / error on unix" New topic
Author

https -- connects fine on windows / error on unix

Mike Ev
Greenhorn

Joined: May 17, 2007
Posts: 11
Recently I had been struggling with some code to get a https connection to work. It was coming up with an error that no trusted certificates could be found. I resolved that thanks to some feedback and sites but i've encountered a new problem -- I'm working on the program on Windows and putting into a unix server to be run. This worked fine initially with no problems, then the server changed from http to https, so I had to implement some changes to deal with this -- now however, even though it works fine on windows when put on unix, it throws up this error

java.net.ConnectException: Connection refused

here's the code..


Any ideas why unix isnt liking this? Thanks a lot
Richard Waldicott
Greenhorn

Joined: Jun 10, 2007
Posts: 9
"Connection refused" indicates that a socket connection could not even be established. This sounds like a possible firewall or routing issue. Try connecting manually from the UNIX box from the shell using the following command

telnet hostname 443

this assumes that 443 is the port your HTTPS is running on. If you can't establish a connection then there is something going on with our firewall, or the hostname just can't be accessed from the UNIX box. Also try a ping.

e.g.

ping hostname
Mike Ev
Greenhorn

Joined: May 17, 2007
Posts: 11
Hi thanks for the reply. I logged on to the unix server, and used
telnet thehostname 7777
and it seemed to connect ok. I then typed 'ls' and this happened:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>501 Method Not Implemented</TITLE>
</HEAD><BODY>
<H1>Method Not Implemented</H1>
ls to /index.html not supported.<P>
Invalid method in request ls<P>
<HR>
<ADDRESS>Oracle-Application-Server-10g/10.1.2.2.0 Oracle-HTTP-Server Server at [thehostname] 443</ADDRESS>
</BODY></HTML>
Connection closed by foreign host.


[thehostname] was the correct hostname. I'm not familiar with telnet so perhaps that's fine. When typing telnet hostname 443 that has 'connection refused'... a little confused why 443 is appearing in the display above.

In the java program, i put a to show what port the url is (on windows), and its coming up as 7777 still so i would assume thats correct. Wonder why windows can do with this and unix cant. Not that it should matter but the program when on unix is on the same server the url is on.

Any more suggestions?
Thanks

Oh and using ping seems to work fine, receives several packets.

[ June 12, 2007: Message edited by: Mike Ev ]
[ June 12, 2007: Message edited by: Mike Ev ]
Mike Ev
Greenhorn

Joined: May 17, 2007
Posts: 11
Just bumping.. any suggestions at all?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: https -- connects fine on windows / error on unix