[net] FTPClient should connect with hostname instead of IP

2020-03-23 Thread Holthof, Lukas
Hello,

I want to connect to a FTP/FTPS server which resides in a different network and 
it not reachable directly from my client. The FTP server's local hostname (e.g. 
ftp.server.corp) is not known to the client. Instead the client should use a 
virtual hostname which gets resolved to the actual local hostname by a Reverse 
Invoke Proxy (e.g. ftp.virtual::ftp.server.corp).

High level scenario:
FTPClient -> SOCKS5 PROXY -> REVERSE INVOKE PROXY -> FTP SERVER

The SocketClient always tries to determine the IP address of the hostname 
provided: e.g. 
InetAddress.getByName(hostname).
I would like to prevent this and use instead: 
_socket_.connect(InetSocketAddress.createUnresolved(host, port), 
connectTimeout);
InetAdresses are used in various places in FTPClient, so similar changes are 
required a couple of times.

Is there a better way preventing the IP resolution on client side? In case not, 
would this be something which could become a switchable feature in Apache 
Commons Net FTPClient/SocketClient?

Regards,
Lukas



Re: JSVC bug or developer oversight?

2020-03-23 Thread Bernd Eckenfels
Helll,

I don't Have the built env here, but this should work, just duplicate any of 
the existing options:

378
 else if (!strcmp(argv[x], "-disablesystemassertions")) {
379
 args->opts[args->onum++] = strdup(argv[x]);
380
 }
else if (!strcmp(argv[x], "--enable-preview)) {
args->opts[args->onum++] = strdup(argv[x]);
}



--
http://bernd.eckenfels.net

Von: ken edward 
Gesendet: Monday, March 23, 2020 6:05:44 PM
An: Commons Users List 
Betreff: Re: JSVC bug or developer oversight?

I tried JDK_JAVA_OPTIONS and it does not seem to work either. I don't
suppose you could send me a source patch for the ability to pass the
--enable_preview parameter?

On Fri, Mar 20, 2020 at 10:57 PM Bernd Eckenfels 
wrote:

> Hello,
>
> Seems not possible to pass options beside the known ones:
>
>
> https://gitbox.apache.org/repos/asf?p=commons-daemon.git;a=blob;f=src/native/unix/native/arguments.c;h=8160c72944a7d7dae9cc8d43ec244f43a664a82f;hb=HEAD#l425
>
> One option is to pass all unknown options to java, another is to pass only
> the missing --enable-preview and lastly an repeatable option  --add-jvm-arg
> "--enable-preview". I think passing the options might be most flexible, but
> it needs to make sure to correctly detect spaces
>
> --start --enable-preview -splash:"/Home/Insane User/foto.jpg"
>
> Maybe adding the one missing option is fastest.
>
> As a workaround, maybe you can use environment variable JDK_JAVA_OPTIONS?
>
> Bernd
> --
> http://bernd.eckenfels.net
> 
> Von: ken edward 
> Gesendet: Friday, March 20, 2020 9:12:57 PM
> An: Commons Users List 
> Betreff: JSVC bug or developer oversight?
>
> Hello,
>
> How do you pass a command line parameter such as --enable-preview while
> using JSVC?
>
> jsvc -help  shows -X and -D but neither of these are appropriate for an
> openjdk command line parameter like --enable-preview ?!?!?!?
>
> -D=
> set a Java system property
> -X
> set Virtual Machine specific option
>
> Ken
>


Re: JSVC bug or developer oversight?

2020-03-23 Thread ken edward
I tried JDK_JAVA_OPTIONS and it does not seem to work either. I don't
suppose you could send me a source patch for the ability to pass the
--enable_preview parameter?

On Fri, Mar 20, 2020 at 10:57 PM Bernd Eckenfels 
wrote:

> Hello,
>
> Seems not possible to pass options beside the known ones:
>
>
> https://gitbox.apache.org/repos/asf?p=commons-daemon.git;a=blob;f=src/native/unix/native/arguments.c;h=8160c72944a7d7dae9cc8d43ec244f43a664a82f;hb=HEAD#l425
>
> One option is to pass all unknown options to java, another is to pass only
> the missing --enable-preview and lastly an repeatable option  --add-jvm-arg
> "--enable-preview". I think passing the options might be most flexible, but
> it needs to make sure to correctly detect spaces
>
> --start --enable-preview -splash:"/Home/Insane User/foto.jpg"
>
> Maybe adding the one missing option is fastest.
>
> As a workaround, maybe you can use environment variable JDK_JAVA_OPTIONS?
>
> Bernd
> --
> http://bernd.eckenfels.net
> 
> Von: ken edward 
> Gesendet: Friday, March 20, 2020 9:12:57 PM
> An: Commons Users List 
> Betreff: JSVC bug or developer oversight?
>
> Hello,
>
> How do you pass a command line parameter such as --enable-preview while
> using JSVC?
>
> jsvc -help  shows -X and -D but neither of these are appropriate for an
> openjdk command line parameter like --enable-preview ?!?!?!?
>
> -D=
> set a Java system property
> -X
> set Virtual Machine specific option
>
> Ken
>