Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 26 Mar 2013 08:43:37 -0500 Date: Tue, 26 Mar 2013 13:43:36 +0000 From: lipska the kat <"nospam at neversurrender dot co dot uk"> Organization: Trollbusters 3 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120410 Thunderbird/11.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: POST to secure server References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 42 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-vKH6ZtHIKudF1RDQAt/1zB1/8MoKwB5oJVBBkxGfZkm5YF0vsxiNGXWykOtnOqyFTBPb5UKnwWIhxrM!ubIsoqwl345NKxpxhWJ6hHApwulLysRpthmotmxEYknvIUe83JZ4AoJu0GgppNc21gksLUprbz4= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2941 Xref: csiph.com comp.lang.java.programmer:23128 On 26/03/13 11:46, RVic wrote: I have an application that must run in windows which must post to a servlet running on a secure server. I can WinSCP into that server, and I can use PuTTY to ssh into that server. But I am quite clueless how I can post to a servlet there? Is there something I can pass in posting, or something I do with my URLConnection or URL variable to allow me access as I get with WinSCP or PuTTY? Thank you. Well fist of all your code sample doesn't show where you are calling getOutputStream on your HttpURLConnection, however given that this is a simple omission on your part ... ssh (secure shell) and scp (secure copy) are protocols, just like http is a protocol. Your 'secure server' is (probably) only secure because it (probably) doesn't allow insecure protocols like telnet and ftp. So far so good http is not a secure protocol so if you can run a servlet container on port 80 (or any other available port for that matter) you can access your servlet in the normal way by making a request. http://foobar.com/servlets/fooservlet?param1=x¶m1=y If you can't access your servlet in this way it's probably because. Your servlet container is listening on a non standard port, or it could be that there is something in the remote network architecture that is stopping your request getting through. Are you running Tomcat, by default it listens on port 8080 so your request would be http://foobar.com:8080/servlets/fooservlet?param1=x¶m2=y what platform is your servlet container running on? lipska -- Lipska the KatŠ: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun