Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #39270

Re: How to create a ssh/tls connection for a tcp connection in java

Path csiph.com!aioe.org!.POSTED.O5hsyUvK01te0L/SZurVSQ.user.gioia.aioe.org!not-for-mail
From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: How to create a ssh/tls connection for a tcp connection in java
Date Fri, 3 Jan 2020 16:45:17 -0500
Organization Aioe.org NNTP Server
Lines 22
Message-ID <quoclb$dl$1@gioia.aioe.org> (permalink)
References <7e6fef16-b107-424a-89c2-f717f9a6d595@googlegroups.com>
NNTP-Posting-Host O5hsyUvK01te0L/SZurVSQ.user.gioia.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1
X-Notice Filtered by postfilter v. 0.9.2
Content-Language en-US
Xref csiph.com comp.lang.java.programmer:39270

Show key headers only | View raw


On 1/3/2020 8:34 AM, mike wrote:
> I am working on creating a call-home function
> https://tools.ietf.org/html/rfc8071 for java.
> 
> Basically something like this:

> AFAIK the tcp connection in java is done using sockets. But then my
> question is how can convert that into a ssh/tls connection. Is there
> a library that supports wrapping sockets into ssh/tls?

SSLSocket is a sub class pf Socket, so you create a SSLSocket and
use it like a Socket.

There are a few variation ins how to create but maybe
something like:

SSLContext sslctx = SSLContext.getInstance("TLSv1.2");
sslctx.init(null, new X509TrustManager[] { new MyTrustManager() }, null);
SSLSocket s = (SSLSocket) sslctx.getSocketFactory().createSocket(HOST, 
PORT);

Arne

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to create a ssh/tls connection for a tcp connection in java mike <mikaelpetterson@hotmail.com> - 2020-01-03 05:34 -0800
  Re: How to create a ssh/tls connection for a tcp connection in java Arne Vajhøj <arne@vajhoej.dk> - 2020-01-03 16:45 -0500
    Re: How to create a ssh/tls connection for a tcp connection in java mike <mikaelpetterson@hotmail.com> - 2020-01-04 09:53 -0800
      Re: How to create a ssh/tls connection for a tcp connection in java Arne Vajhøj <arne@vajhoej.dk> - 2020-01-04 13:09 -0500
      Re: How to create a ssh/tls connection for a tcp connection in java Martin Gregorie <martin@mydomain.invalid> - 2020-01-04 18:56 +0000

csiph-web